12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739 |
- using Burst.Compiler.IL.Tests.Helpers;
- using NUnit.Framework;
- using Unity.Mathematics;
-
- namespace Burst.Compiler.IL.Tests
- {
- [TestFixture]
- internal partial class VectorsMaths
- {
- [TestCompiler]
- public static ulong HalfToFloatAndDouble()
- {
- return math.asuint(new half {value = 0x0000})
- + math.asulong(new half {value = 0x1000});
- }
-
- // ---------------------------------------------------------
- // asfloat
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float AsFloatInt4(ref int4 a)
- {
- return Vectors.ConvertToFloat(math.asfloat(a));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float AsFloatInt3(ref int3 a)
- {
- return Vectors.ConvertToFloat(math.asfloat(a));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float AsFloatInt2(ref int2 a)
- {
- return Vectors.ConvertToFloat(math.asfloat(a));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float AsFloatUInt4(ref uint4 a)
- {
- return Vectors.ConvertToFloat(math.asfloat(a));
- }
-
- // ---------------------------------------------------------
- // asint
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static int AsIntFloat4(ref float4 a)
- {
- return Vectors.ConvertToInt(math.asint(a));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int AsIntFloat3(ref float3 a)
- {
- return Vectors.ConvertToInt(math.asint(a));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int AsIntFloat2(ref float2 a)
- {
- return Vectors.ConvertToInt(math.asint(a));
- }
-
- // ---------------------------------------------------------
- // asuint
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static int AsUIntFloat4(ref float4 a)
- {
- return Vectors.ConvertToInt(math.asuint(a));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int AsUIntFloat3(ref float3 a)
- {
- return Vectors.ConvertToInt(math.asuint(a));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int AsUIntFloat2(ref float2 a)
- {
- return Vectors.ConvertToInt(math.asuint(a));
- }
-
- // ---------------------------------------------------------
- // compress
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static unsafe int CompressInt4(ref int4 value, ref bool4 mask)
- {
- var temp = default(TestCompressInt4);
-
- var ptr = &temp.Value0;
- var count = math.compress(ptr, 0, value, mask);
-
- int result = 0;
- for (int i = 0; i < count; i++)
- {
- result = result * 397 + ptr[i];
- }
-
- return result;
- }
-
- // ---------------------------------------------------------
- // compress
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static unsafe uint CompressUInt4(ref uint4 value, ref bool4 mask)
- {
- var temp = default(TestCompressUInt4);
-
- var ptr = &temp.Value0;
- var count = math.compress(ptr, 0, value, mask);
-
- uint result = 0;
- for (int i = 0; i < count; i++)
- {
- result = result * 397 + ptr[i];
- }
-
- return result;
- }
-
- // ---------------------------------------------------------
- // compress
- // ---------------------------------------------------------
- // IL2CPP codegen on Android fixed in 2023.1
- // ... but now it's broken on Switch
- // ... and also broken on macOS
- #if BURST_TESTS_ONLY || (UNITY_2023_1_OR_NEWER && !UNITY_SWITCH && !UNITY_STANDALONE_OSX)
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static unsafe float CompressFloat4(ref float4 value, ref bool4 mask)
- {
- var temp = default(TestCompressFloat4);
-
- var ptr = &temp.Value0;
- var count = math.compress(ptr, 0, value, mask);
-
- float result = 0;
- for (int i = 0; i < count; i++)
- {
- result = result * 397 + ptr[i];
- }
-
- return result;
- }
- #endif
-
- // ---------------------------------------------------------
- // count_bits
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static int CountBitsInt(int value)
- {
- return math.countbits(value);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int CountBitsInt2(ref int2 value)
- {
- return Vectors.ConvertToInt(math.countbits(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int CountBitsInt3(ref int3 value)
- {
- return Vectors.ConvertToInt(math.countbits(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int CountBitsInt4(ref int4 value)
- {
- return Vectors.ConvertToInt(math.countbits(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int CountBitsUInt(uint value)
- {
- return math.countbits(value);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int CountBitsUInt2(ref uint2 value)
- {
- return Vectors.ConvertToInt(math.countbits(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int CountBitsUInt3(ref uint3 value)
- {
- return Vectors.ConvertToInt(math.countbits(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int CountBitsUInt4(ref uint4 value)
- {
- return Vectors.ConvertToInt(math.countbits(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int CountBitsLong(long value)
- {
- return math.countbits(value);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int CountBitsULong(ulong value)
- {
- return math.countbits(value);
- }
-
- // ---------------------------------------------------------
- // lzcnt
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static int LzCntInt(int value)
- {
- return math.lzcnt(value);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int LzCntInt2(ref int2 value)
- {
- return Vectors.ConvertToInt(math.lzcnt(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int LzCntInt3(ref int3 value)
- {
- return Vectors.ConvertToInt(math.lzcnt(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int LzCntInt4(ref int4 value)
- {
- return Vectors.ConvertToInt(math.lzcnt(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int LzCntUInt(uint value)
- {
- return math.lzcnt(value);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int LzCntUInt2(ref uint2 value)
- {
- return Vectors.ConvertToInt(math.lzcnt(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int LzCntUInt3(ref uint3 value)
- {
- return Vectors.ConvertToInt(math.lzcnt(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int LzCntUInt4(ref uint4 value)
- {
- return Vectors.ConvertToInt(math.lzcnt(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int LzCntLong(long value)
- {
- return math.lzcnt(value);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int LzCntULong(ulong value)
- {
- return math.lzcnt(value);
- }
-
- // ---------------------------------------------------------
- // tzcnt
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static int TzCntInt(int value)
- {
- return math.tzcnt(value);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int TzCntInt2(ref int2 value)
- {
- return Vectors.ConvertToInt(math.tzcnt(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int TzCntInt3(ref int3 value)
- {
- return Vectors.ConvertToInt(math.tzcnt(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int TzCntInt4(ref int4 value)
- {
- return Vectors.ConvertToInt(math.tzcnt(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int TzCntUInt(uint value)
- {
- return math.tzcnt(value);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int TzCntUInt2(ref uint2 value)
- {
- return Vectors.ConvertToInt(math.tzcnt(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int TzCntUInt3(ref uint3 value)
- {
- return Vectors.ConvertToInt(math.tzcnt(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int TzCntUInt4(ref uint4 value)
- {
- return Vectors.ConvertToInt(math.tzcnt(value));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int TzCntLong(long value)
- {
- return math.tzcnt(value);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int TzCntULong(ulong value)
- {
- return math.tzcnt(value);
- }
-
- // ---------------------------------------------------------
- // min
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Min4(ref float4 a, ref float4 b)
- {
- return Vectors.ConvertToFloat(math.min(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Min3(ref float3 a, ref float3 b)
- {
- return Vectors.ConvertToFloat(math.min(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Min2(ref float2 a, ref float2 b)
- {
- return Vectors.ConvertToFloat(math.min(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Min(float a, float b)
- {
- return math.min(a, b);
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static int MinInt4(ref int4 a, ref int4 b)
- {
- return Vectors.ConvertToInt(math.min(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static int MinInt3(ref int3 a, ref int3 b)
- {
- return Vectors.ConvertToInt(math.min(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static int MinInt2(ref int2 a, ref int2 b)
- {
- return Vectors.ConvertToInt(math.min(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static int MinInt(int a, int b)
- {
- return math.min(a, b);
- }
-
- // ---------------------------------------------------------
- // max
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Max4(ref float4 a, ref float4 b)
- {
- return Vectors.ConvertToFloat(math.max(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Max3(ref float3 a, ref float3 b)
- {
- return Vectors.ConvertToFloat(math.max(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Max2(ref float2 a, ref float2 b)
- {
- return Vectors.ConvertToFloat(math.max(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Max(float a, float b)
- {
- return math.max(a, b);
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static int MaxInt4(ref int4 a, ref int4 b)
- {
- return Vectors.ConvertToInt(math.max(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static int MaxInt3(ref int3 a, ref int3 b)
- {
- return Vectors.ConvertToInt(math.max(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static int MaxInt2(ref int2 a, ref int2 b)
- {
- return Vectors.ConvertToInt(math.max(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float MaxInt(int a, int b)
- {
- return math.max(a, b);
- }
-
- // ---------------------------------------------------------
- // lerp
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.ZeroExclusiveToOneInclusive|DataRange.Zero)]
- public static float Lerp4(ref float4 a, ref float4 b, float w)
- {
- return Vectors.ConvertToFloat(math.lerp(a, b, w));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.ZeroExclusiveToOneInclusive | DataRange.Zero)]
- public static float Lerp3(ref float3 a, ref float3 b, float w)
- {
- return Vectors.ConvertToFloat(math.lerp(a, b, w));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.ZeroExclusiveToOneInclusive | DataRange.Zero)]
- public static float Lerp2(ref float2 a, ref float2 b, float w)
- {
- return Vectors.ConvertToFloat(math.lerp(a, b, w));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.ZeroExclusiveToOneInclusive | DataRange.Zero)]
- public static float Lerp(float a, float b, float w)
- {
- return math.lerp(a, b, w);
- }
-
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.ZeroExclusiveToOneInclusive | DataRange.Zero)]
- public static float Lerp4_4(ref float4 a, ref float4 b, ref float4 w)
- {
- return Vectors.ConvertToFloat(math.lerp(a, b, w));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.ZeroExclusiveToOneInclusive | DataRange.Zero)]
- public static float Lerp3_3(ref float3 a, ref float3 b, ref float3 w)
- {
- return Vectors.ConvertToFloat(math.lerp(a, b, w));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.ZeroExclusiveToOneInclusive | DataRange.Zero)]
- public static float Lerp2_2(ref float2 a, ref float2 b, ref float2 w)
- {
- return Vectors.ConvertToFloat(math.lerp(a, b, w));
- }
-
- // ---------------------------------------------------------
- // mad
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static float Mad4(ref float4 a, ref float4 b, ref float4 c)
- {
- return Vectors.ConvertToFloat(math.mad(a, b, c));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static float Mad3(ref float3 a, ref float3 b, ref float3 c)
- {
- return Vectors.ConvertToFloat(math.mad(a, b, c));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static float Mad2(ref float2 a, ref float2 b, ref float2 c)
- {
- return Vectors.ConvertToFloat(math.mad(a, b, c));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static float Mad(float a, float b, float c)
- {
- return math.mad(a, b, c);
- }
-
- // ---------------------------------------------------------
- // clamp
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static float Clamp4(ref float4 x, ref float4 a, ref float4 b)
- {
- return Vectors.ConvertToFloat(math.clamp(x, a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static float Clamp3(ref float3 x, ref float3 a, ref float3 b)
- {
- return Vectors.ConvertToFloat(math.clamp(x, a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static float Clamp2(ref float2 x, ref float2 a, ref float2 b)
- {
- return Vectors.ConvertToFloat(math.clamp(x, a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static float Clamp(float x, float a, float b)
- {
- return math.clamp(x, a, b);
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static int ClampInt4(ref int4 x, ref int4 a, ref int4 b)
- {
- return Vectors.ConvertToInt(math.clamp(x, a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static int ClampInt3(ref int3 x, ref int3 a, ref int3 b)
- {
- return Vectors.ConvertToInt(math.clamp(x, a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static int ClampInt2(ref int2 x, ref int2 a, ref int2 b)
- {
- return Vectors.ConvertToInt(math.clamp(x, a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static int ClampInt(int x, int a, int b)
- {
- return math.clamp(x, a, b);
- }
-
- // ---------------------------------------------------------
- // saturate
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Saturate4(ref float4 x)
- {
- return Vectors.ConvertToFloat(math.saturate(x));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Saturate3(ref float3 x)
- {
- return Vectors.ConvertToFloat(math.saturate(x));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Saturate2(ref float2 x)
- {
- return Vectors.ConvertToFloat(math.saturate(x));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Saturate(float x)
- {
- return math.saturate(x);
- }
-
- // ---------------------------------------------------------
- // abs
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Abs4(ref float4 x)
- {
- return Vectors.ConvertToFloat(math.abs(x));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Abs3(ref float3 x)
- {
- return Vectors.ConvertToFloat(math.abs(x));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Abs2(ref float2 x)
- {
- return Vectors.ConvertToFloat(math.abs(x));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Abs(float x)
- {
- return math.abs(x);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static double AbsDouble4(ref double4 x)
- {
- return Vectors.ConvertToDouble(math.abs(x));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static double AbsDouble3(ref double3 x)
- {
- return Vectors.ConvertToDouble(math.abs(x));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static double AbsDouble2(ref double2 x)
- {
- return Vectors.ConvertToDouble(math.abs(x));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static double AbsDouble(double x)
- {
- return math.abs(x);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int AbsInt4(ref int4 x)
- {
- return Vectors.ConvertToInt(math.abs(x));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int AbsInt3(ref int3 x)
- {
- return Vectors.ConvertToInt(math.abs(x));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int AbsInt2(ref int2 x)
- {
- return Vectors.ConvertToInt(math.abs(x));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static int AbsInt(int x)
- {
- return math.abs(x);
- }
-
- // ---------------------------------------------------------
- // dot
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Dot4(ref float4 a, ref float4 b)
- {
- return math.dot(a, b);
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Dot3(ref float3 a, ref float3 b)
- {
- return math.dot(a, b);
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Dot2(ref float2 a, ref float2 b)
- {
- return math.dot(a, b);
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Dot(float a, float b)
- {
- return math.dot(a, b);
- }
-
- // ---------------------------------------------------------
- // cmin
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard & ~DataRange.NaN)] // TODO: Does no handle NaN correctly
- public static float CMin4(ref float4 input)
- {
- return math.cmin(input);
- }
-
- [TestCompiler(DataRange.Standard & ~DataRange.NaN)] // TODO: Does no handle NaN correctly
- public static float CMin3(ref float3 input)
- {
- return math.cmin(input);
- }
-
- [TestCompiler(DataRange.Standard & ~DataRange.NaN)] // TODO: Does no handle NaN correctly
- public static float CMin2(ref float2 input)
- {
- return math.cmin(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float CMinInt4(ref int4 input)
- {
- return math.cmin(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float CMinInt3(ref int3 input)
- {
- return math.cmin(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float CMinInt2(ref int2 input)
- {
- return math.cmin(input);
- }
-
- // ---------------------------------------------------------
- // cmax
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard & ~DataRange.NaN)] // TODO: Does no handle NaN correctly
- public static float CMax4(ref float4 input)
- {
- return math.cmax(input);
- }
-
- [TestCompiler(DataRange.Standard & ~DataRange.NaN)] // TODO: Does no handle NaN correctly
- public static float CMax3(ref float3 input)
- {
- return math.cmax(input);
- }
-
- [TestCompiler(DataRange.Standard & ~DataRange.NaN)] // TODO: Does no handle NaN correctly
- public static float CMax2(ref float2 input)
- {
- return math.cmax(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float CMaxInt4(ref int4 input)
- {
- return math.cmax(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float CMaxInt3(ref int3 input)
- {
- return math.cmax(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float CMaxInt2(ref int2 input)
- {
- return math.cmax(input);
- }
-
- // ---------------------------------------------------------
- // csum
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static double CSum4d(ref double4 input)
- {
- return math.csum(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float CSum4(ref float4 input)
- {
- return math.csum(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float CSum3(ref float3 input)
- {
- return math.csum(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float CSum2(ref float2 input)
- {
- return math.csum(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float CSumInt4(ref int4 input)
- {
- return math.csum(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float CSumInt3(ref int3 input)
- {
- return math.csum(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float CSumInt2(ref int2 input)
- {
- return math.csum(input);
- }
-
- // ---------------------------------------------------------
- // acos
- // ---------------------------------------------------------
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ACos4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.acos(input));
- }
-
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ACos3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.acos(input));
- }
-
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ACos2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.acos(input));
- }
-
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ACos(float input)
- {
- return math.acos(input);
- }
-
- // ---------------------------------------------------------
- // asin
- // ---------------------------------------------------------
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ASin4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.asin(input));
- }
-
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ASin3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.asin(input));
- }
-
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ASin2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.asin(input));
- }
-
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ASin(float input)
- {
- return math.asin(input);
- }
-
- // ---------------------------------------------------------
- // atan
- // ---------------------------------------------------------
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ATan_4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.atan(input));
- }
-
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ATan_3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.atan(input));
- }
-
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ATan_2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.atan(input));
- }
-
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ATan(float input)
- {
- return math.atan(input);
- }
-
- // ---------------------------------------------------------
- // atan2
- // ---------------------------------------------------------
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive, DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ATan2_4(ref float4 a, ref float4 b)
- {
- return Vectors.ConvertToFloat(math.atan2(a, b));
- }
-
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive, DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ATan2_3(ref float3 a, ref float3 b)
- {
- return Vectors.ConvertToFloat(math.atan2(a, b));
- }
-
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive, DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ATan2_2(ref float2 a, ref float2 b)
- {
- return Vectors.ConvertToFloat(math.atan2(a, b));
- }
-
- [TestCompiler(DataRange.MinusOneInclusiveToOneInclusive, DataRange.MinusOneInclusiveToOneInclusive)]
- public static float ATan2(float a, float b)
- {
- return math.atan2(a, b);
- }
-
- // ---------------------------------------------------------
- // cos
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static double Cos4d(ref double4 input)
- {
- return Vectors.ConvertToDouble(math.cos(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Cos4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.cos(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Cos3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.cos(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Cos2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.cos(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Cos(float input)
- {
- return math.cos(input);
- }
-
- // ---------------------------------------------------------
- // cosh
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static double Cosh4d(ref double4 input)
- {
- return Vectors.ConvertToDouble(math.cosh(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Cosh4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.cosh(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Cosh3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.cosh(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Cosh2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.cosh(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Cosh(float input)
- {
- return math.cosh(input);
- }
-
- // ---------------------------------------------------------
- // sin
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static double Sin4d(ref double4 input)
- {
- return Vectors.ConvertToDouble(math.sin(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Sin4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.sin(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Sin3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.sin(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Sin2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.sin(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Sin(float input)
- {
- return math.sin(input);
- }
-
- // ---------------------------------------------------------
- // sinh
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Sinh4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.sinh(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Sinh3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.sinh(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Sinh2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.sinh(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Sinh(float input)
- {
- return math.sinh(input);
- }
-
- // ---------------------------------------------------------
- // sincos
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float SinCos4(ref float4 input)
- {
- float4 sina, cosa;
- math.sincos(input, out sina, out cosa);
- return Vectors.ConvertToFloat(sina) + Vectors.ConvertToFloat(cosa) * 7.1f;
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float SinCos3(ref float3 input)
- {
- float3 sina, cosa;
- math.sincos(input, out sina, out cosa);
- return Vectors.ConvertToFloat(sina) + Vectors.ConvertToFloat(cosa) * 7.1f;
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float SinCos2(ref float2 input)
- {
- float2 sina, cosa;
- math.sincos(input, out sina, out cosa);
- return Vectors.ConvertToFloat(sina) + Vectors.ConvertToFloat(cosa) * 7.1f;
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float SinCos(float input)
- {
- float sina, cosa;
- math.sincos(input, out sina, out cosa);
- return sina + cosa * 7.1f;
- }
-
- // ---------------------------------------------------------
- // tanh
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Tanh4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.tanh(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Tanh3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.tanh(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Tanh2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.tanh(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Tanh(float input)
- {
- return math.tanh(input);
- }
-
- // ---------------------------------------------------------
- // sqrt
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Sqrt4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.sqrt(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Sqrt3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.sqrt(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Sqrt2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.sqrt(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Sqrt(float input)
- {
- return math.sqrt(input);
- }
-
- // ---------------------------------------------------------
- // rsqrt
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float RSqrt4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.rsqrt(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float RSqrt3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.rsqrt(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float RSqrt2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.rsqrt(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float RSqrt(float input)
- {
- return math.rsqrt(input);
- }
-
- // ---------------------------------------------------------
- // floor
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Floor4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.floor(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Floor3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.floor(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Floor2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.floor(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Floor(float input)
- {
- return math.floor(input);
- }
-
- // ---------------------------------------------------------
- // ceil
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Ceil4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.ceil(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Ceil3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.ceil(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Ceil2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.ceil(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Ceil(float input)
- {
- return math.ceil(input);
- }
-
- // ---------------------------------------------------------
- // round
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Round4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.round(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Round3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.round(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Round2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.round(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Round(float input)
- {
- return math.round(input);
- }
-
- // ---------------------------------------------------------
- // frac
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Frac4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.frac(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Frac3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.frac(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Frac2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.frac(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Frac(float input)
- {
- return math.frac(input);
- }
-
- // ---------------------------------------------------------
- // rcp
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Rcp4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.rcp(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Rcp3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.rcp(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Rcp2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.rcp(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Rcp(float input)
- {
- return math.rcp(input);
- }
-
- // ---------------------------------------------------------
- // sign
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Sign4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.sign(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Sign3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.sign(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Sign2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.sign(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Sign(float input)
- {
- return math.sign(input);
- }
-
- // ---------------------------------------------------------
- // pow
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard & ~(DataRange.NaN | DataRange.Zero), DataRange.Standard)]
- [TestCompiler(DataRange.Standard & ~(DataRange.NaN), DataRange.Standard & ~(DataRange.Zero))]
- public static float Pow4(ref float4 a, ref float4 b)
- {
- return Vectors.ConvertToFloat(math.pow(a, b));
- }
-
- [TestCompiler(DataRange.Standard & ~(DataRange.NaN | DataRange.Zero), DataRange.Standard)]
- [TestCompiler(DataRange.Standard & ~(DataRange.NaN), DataRange.Standard & ~(DataRange.Zero))]
- public static float Pow3(ref float3 a, ref float3 b)
- {
- return Vectors.ConvertToFloat(math.pow(a, b));
- }
-
- [TestCompiler(DataRange.Standard & ~(DataRange.NaN | DataRange.Zero), DataRange.Standard)]
- [TestCompiler(DataRange.Standard & ~(DataRange.NaN), DataRange.Standard & ~(DataRange.Zero))]
- public static float Pow2(ref float2 a, ref float2 b)
- {
- return Vectors.ConvertToFloat(math.pow(a, b));
- }
-
- [TestCompiler(DataRange.Standard & ~(DataRange.NaN | DataRange.Zero), DataRange.Standard)]
- [TestCompiler(DataRange.Standard & ~(DataRange.NaN), DataRange.Standard & ~(DataRange.Zero))]
- public static float Pow(float a, float b)
- {
- return math.pow(a, b);
- }
-
- // ---------------------------------------------------------
- // exp
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Exp4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.exp(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Exp3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.exp(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Exp2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.exp(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Exp(float input)
- {
- return math.exp(input);
- }
-
- // ---------------------------------------------------------
- // mod
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Mod4(ref float4 a, ref float4 b)
- {
- return Vectors.ConvertToFloat(math.fmod(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Mod3(ref float3 a, ref float3 b)
- {
- return Vectors.ConvertToFloat(math.fmod(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Mod2(ref float2 a, ref float2 b)
- {
- return Vectors.ConvertToFloat(math.fmod(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Mod(float a, float b)
- {
- return math.fmod(a, b);
- }
-
- // ---------------------------------------------------------
- // normalize
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Normalize4(ref float4 input)
- {
- return Vectors.ConvertToFloat(math.normalize(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Normalize3(ref float3 input)
- {
- return Vectors.ConvertToFloat(math.normalize(input));
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Normalize2(ref float2 input)
- {
- return Vectors.ConvertToFloat(math.normalize(input));
- }
-
- // ---------------------------------------------------------
- // length
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static float Length4(ref float4 input)
- {
- return math.length(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Length3(ref float3 input)
- {
- return math.length(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Length2(ref float2 input)
- {
- return math.length(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static float Length(float input)
- {
- return math.length(input);
- }
-
- // ---------------------------------------------------------
- // distance
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Distance4(ref float4 a, ref float4 b)
- {
- return math.distance(a, b);
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Distance3(ref float3 a, ref float3 b)
- {
- return math.distance(a, b);
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Distance2(ref float2 a, ref float2 b)
- {
- return math.distance(a, b);
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Distance(float a, float b)
- {
- return math.distance(a, b);
- }
-
- // ---------------------------------------------------------
- // cross
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Cross3(ref float3 a, ref float3 b)
- {
- return Vectors.ConvertToFloat(math.cross(a, b));
- }
-
- // ---------------------------------------------------------
- // smoothstep
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.ZeroExclusiveToOneInclusive | DataRange.Zero)]
- public static float Smoothstep4(ref float4 a, ref float4 b, float w)
- {
- return Vectors.ConvertToFloat(math.smoothstep(a, b, w));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.ZeroExclusiveToOneInclusive | DataRange.Zero)]
- public static float Smoothstep3(ref float3 a, ref float3 b, float w)
- {
- return Vectors.ConvertToFloat(math.smoothstep(a, b, w));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.ZeroExclusiveToOneInclusive | DataRange.Zero)]
- public static float Smoothstep2(ref float2 a, ref float2 b, float w)
- {
- return Vectors.ConvertToFloat(math.smoothstep(a, b, w));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.ZeroExclusiveToOneInclusive | DataRange.Zero)]
- public static float Smoothstep(float a, float b, float w)
- {
- return math.smoothstep(a, b, w);
- }
-
- // ---------------------------------------------------------
- // any
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static bool Any4(ref float4 input)
- {
- return math.any(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool Any32(ref float3 input)
- {
- return math.any(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool Any(ref float2 input)
- {
- return math.any(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool AnyInt4(ref int4 input)
- {
- return math.any(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool AnyInt3(ref int3 input)
- {
- return math.any(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool AnyInt2(ref int2 input)
- {
- return math.any(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool AnyBool4(ref bool4 input)
- {
- return math.any(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool AnyBool3(ref bool3 input)
- {
- return math.any(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool AnyBool2(ref bool2 input)
- {
- return math.any(input);
- }
-
- // ---------------------------------------------------------
- // all
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard)]
- public static bool All4(ref float4 input)
- {
- return math.all(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool All3(ref float3 input)
- {
- return math.all(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool All2(ref float2 input)
- {
- return math.all(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool AllInt4(ref int4 input)
- {
- return math.all(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool AllInt3(ref int3 input)
- {
- return math.all(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool AllInt2(ref int2 input)
- {
- return math.all(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool AllBool4(ref bool4 input)
- {
- return math.all(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool AllBool3(ref bool3 input)
- {
- return math.all(input);
- }
-
- [TestCompiler(DataRange.Standard)]
- public static bool AllBool2(ref bool2 input)
- {
- return math.all(input);
- }
-
- // ---------------------------------------------------------
- // select
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static float Select4(ref bool4 c, ref float4 a, ref float4 b)
- {
- return Vectors.ConvertToFloat(math.select(a, b, c));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static float Select3(ref bool3 c, ref float3 a, ref float3 b)
- {
- return Vectors.ConvertToFloat(math.select(a, b, c));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard, DataRange.Standard)]
- public static float Select(ref bool2 c, ref float2 a, ref float2 b)
- {
- return Vectors.ConvertToFloat(math.select(a, b, c));
- }
-
- // ---------------------------------------------------------
- // step
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Step4(ref float4 a, ref float4 b)
- {
- return Vectors.ConvertToFloat(math.step(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Step3(ref float3 a, ref float3 b)
- {
- return Vectors.ConvertToFloat(math.step(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Step2(ref float2 a, ref float2 b)
- {
- return Vectors.ConvertToFloat(math.step(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Step(float a, float b)
- {
- return math.step(a, b);
- }
-
- // ---------------------------------------------------------
- // reflect
- // ---------------------------------------------------------
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Reflect4(ref float4 a, ref float4 b)
- {
- return Vectors.ConvertToFloat(math.reflect(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Reflect3(ref float3 a, ref float3 b)
- {
- return Vectors.ConvertToFloat(math.reflect(a, b));
- }
-
- [TestCompiler(DataRange.Standard, DataRange.Standard)]
- public static float Reflect2(ref float2 a, ref float2 b)
- {
- return Vectors.ConvertToFloat(math.reflect(a, b));
- }
-
- struct TestCompressInt4
- {
- #pragma warning disable 0649
- public int Value0;
- public int Value1;
- public int Value2;
- public int Value3;
- #pragma warning restore 0649
- }
-
- struct TestCompressUInt4
- {
- #pragma warning disable 0649
- public uint Value0;
- public uint Value1;
- public uint Value2;
- public uint Value3;
- #pragma warning restore 0649
- }
-
- struct TestCompressFloat4
- {
- #pragma warning disable 0649
- public float Value0;
- public float Value1;
- public float Value2;
- public float Value3;
- #pragma warning restore 0649
- }
- }
- }
|