123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674 |
- 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;
- }
-
- // ---------------------------------------------------------
- // 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
- }
- }
- }
|