暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

090-Vectors-Equals.cs 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. using Burst.Compiler.IL.Tests.Helpers;
  2. using NUnit.Framework;
  3. using Unity.Mathematics;
  4. namespace Burst.Compiler.IL.Tests
  5. {
  6. [TestFixture]
  7. internal partial class VectorsEquality
  8. {
  9. // Float4
  10. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  11. public static bool Float4Equals(ref float4 a, ref float4 b)
  12. {
  13. return a.Equals(b);
  14. }
  15. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  16. public static int Float4Equality(ref float4 a, ref float4 b)
  17. {
  18. return Vectors.ConvertToInt(a == b);
  19. }
  20. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  21. public static int Float4Inequality(ref float4 a, ref float4 b)
  22. {
  23. return Vectors.ConvertToInt(a != b);
  24. }
  25. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  26. public static int Float4EqualityWithFloat(ref float4 a, float b)
  27. {
  28. return Vectors.ConvertToInt(a == b);
  29. }
  30. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  31. public static int Float4InequalityWithFloat(ref float4 a, float b)
  32. {
  33. return Vectors.ConvertToInt(a != b);
  34. }
  35. // Float3
  36. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  37. public static bool Float3Equals(ref float3 a, ref float3 b)
  38. {
  39. return a.Equals(b);
  40. }
  41. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  42. public static int Float3Equality(ref float3 a, ref float3 b)
  43. {
  44. return Vectors.ConvertToInt(a == b);
  45. }
  46. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  47. public static int Float3Inequality(ref float3 a, ref float3 b)
  48. {
  49. return Vectors.ConvertToInt(a != b);
  50. }
  51. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  52. public static int Float3EqualityWithFloat(ref float3 a, float b)
  53. {
  54. return Vectors.ConvertToInt(a == b);
  55. }
  56. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  57. public static int Float3InequalityWithFloat(ref float3 a, float b)
  58. {
  59. return Vectors.ConvertToInt(a != b);
  60. }
  61. // Float2
  62. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  63. public static bool Float2Equals(ref float2 a, ref float2 b)
  64. {
  65. return a.Equals(b);
  66. }
  67. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  68. public static int Float2Equality(ref float2 a, ref float2 b)
  69. {
  70. return Vectors.ConvertToInt(a == b);
  71. }
  72. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  73. public static int Float2Inequality(ref float2 a, ref float2 b)
  74. {
  75. return Vectors.ConvertToInt(a != b);
  76. }
  77. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  78. public static int Float2EqualityWithFloat(ref float2 a, float b)
  79. {
  80. return Vectors.ConvertToInt(a == b);
  81. }
  82. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  83. public static int Float2InequalityWithFloat(ref float2 a, float b)
  84. {
  85. return Vectors.ConvertToInt(a != b);
  86. }
  87. // Int4
  88. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  89. public static bool Int4Equals(ref int4 a, ref int4 b)
  90. {
  91. return a.Equals(b);
  92. }
  93. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  94. public static int Int4Equality(ref int4 a, ref int4 b)
  95. {
  96. return Vectors.ConvertToInt(a == b);
  97. }
  98. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  99. public static int Int4Inequality(ref int4 a, ref int4 b)
  100. {
  101. return Vectors.ConvertToInt(a != b);
  102. }
  103. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  104. public static int Int4EqualityWithScalar(ref int4 a, int b)
  105. {
  106. return Vectors.ConvertToInt(a == b);
  107. }
  108. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  109. public static int Int4InequalityWithScalar(ref int4 a, int b)
  110. {
  111. return Vectors.ConvertToInt(a != b);
  112. }
  113. // Int3
  114. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  115. public static bool Int3Equals(ref int3 a, ref int3 b)
  116. {
  117. return a.Equals(b);
  118. }
  119. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  120. public static int Int3Equality(ref int3 a, ref int3 b)
  121. {
  122. return Vectors.ConvertToInt(a == b);
  123. }
  124. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  125. public static int Int3Inequality(ref int3 a, ref int3 b)
  126. {
  127. return Vectors.ConvertToInt(a != b);
  128. }
  129. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  130. public static int Int3EqualityWithScalar(ref int3 a, int b)
  131. {
  132. return Vectors.ConvertToInt(a == b);
  133. }
  134. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  135. public static int Int3InequalityWithScalar(ref int3 a, int b)
  136. {
  137. return Vectors.ConvertToInt(a != b);
  138. }
  139. // Int2
  140. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  141. public static bool Int2Equals(ref int2 a, ref int2 b)
  142. {
  143. return a.Equals(b);
  144. }
  145. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  146. public static int Int2Equality(ref int2 a, ref int2 b)
  147. {
  148. return Vectors.ConvertToInt(a == b);
  149. }
  150. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  151. public static int Int2Inequality(ref int2 a, ref int2 b)
  152. {
  153. return Vectors.ConvertToInt(a != b);
  154. }
  155. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  156. public static int Int2EqualityWithScalar(ref int2 a, int b)
  157. {
  158. return Vectors.ConvertToInt(a == b);
  159. }
  160. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  161. public static int Int2InequalityWithScalar(ref int2 a, int b)
  162. {
  163. return Vectors.ConvertToInt(a != b);
  164. }
  165. // UInt4
  166. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  167. public static bool UInt4Equals(ref uint4 a, ref uint4 b)
  168. {
  169. return a.Equals(b);
  170. }
  171. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  172. public static int UInt4Equality(ref uint4 a, ref uint4 b)
  173. {
  174. return Vectors.ConvertToInt(a == b);
  175. }
  176. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  177. public static int UInt4Inequality(ref uint4 a, ref uint4 b)
  178. {
  179. return Vectors.ConvertToInt(a != b);
  180. }
  181. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  182. public static int UInt4EqualityWithScalar(ref uint4 a, uint b)
  183. {
  184. return Vectors.ConvertToInt(a == b);
  185. }
  186. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  187. public static int UInt4InequalityWithScalar(ref uint4 a, uint b)
  188. {
  189. return Vectors.ConvertToInt(a != b);
  190. }
  191. // UInt3
  192. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  193. public static bool UInt3Equals(ref uint3 a, ref uint3 b)
  194. {
  195. return a.Equals(b);
  196. }
  197. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  198. public static int UInt3Equality(ref uint3 a, ref uint3 b)
  199. {
  200. return Vectors.ConvertToInt(a == b);
  201. }
  202. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  203. public static int UInt3Inequality(ref uint3 a, ref uint3 b)
  204. {
  205. return Vectors.ConvertToInt(a != b);
  206. }
  207. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  208. public static int UInt3EqualityWithScalar(ref uint3 a, uint b)
  209. {
  210. return Vectors.ConvertToInt(a == b);
  211. }
  212. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  213. public static int UInt3InequalityWithScalar(ref uint3 a, uint b)
  214. {
  215. return Vectors.ConvertToInt(a != b);
  216. }
  217. // Int2
  218. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  219. public static bool UInt2Equals(ref uint2 a, ref uint2 b)
  220. {
  221. return a.Equals(b);
  222. }
  223. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  224. public static int UInt2Equality(ref uint2 a, ref uint2 b)
  225. {
  226. return Vectors.ConvertToInt(a == b);
  227. }
  228. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  229. public static int UInt2Inequality(ref uint2 a, ref uint2 b)
  230. {
  231. return Vectors.ConvertToInt(a != b);
  232. }
  233. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  234. public static int UInt2EqualityWithScalar(ref uint2 a, uint b)
  235. {
  236. return Vectors.ConvertToInt(a == b);
  237. }
  238. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  239. public static int UInt2InequalityWithScalar(ref uint2 a, uint b)
  240. {
  241. return Vectors.ConvertToInt(a != b);
  242. }
  243. // Bool4
  244. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  245. public static bool Bool4Equals(ref bool4 a, ref bool4 b)
  246. {
  247. return a.Equals(b);
  248. }
  249. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  250. public static int Bool4Equality(ref bool4 a, ref bool4 b)
  251. {
  252. return Vectors.ConvertToInt(a == b);
  253. }
  254. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  255. public static int Bool4Inequality(ref bool4 a, ref bool4 b)
  256. {
  257. return Vectors.ConvertToInt(a != b);
  258. }
  259. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  260. public static int Bool4EqualityWithScalar(ref bool4 a, bool b)
  261. {
  262. return Vectors.ConvertToInt(a == b);
  263. }
  264. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  265. public static int Bool4InequalityWithScalar(ref bool4 a, bool b)
  266. {
  267. return Vectors.ConvertToInt(a != b);
  268. }
  269. // Bool3
  270. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  271. public static bool Bool3Equals(ref bool3 a, ref bool3 b)
  272. {
  273. return a.Equals(b);
  274. }
  275. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  276. public static int Bool3Equality(ref bool3 a, ref bool3 b)
  277. {
  278. return Vectors.ConvertToInt(a == b);
  279. }
  280. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  281. public static int Bool3Inequality(ref bool3 a, ref bool3 b)
  282. {
  283. return Vectors.ConvertToInt(a != b);
  284. }
  285. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  286. public static int Bool3EqualityWithScalar(ref bool3 a, bool b)
  287. {
  288. return Vectors.ConvertToInt(a == b);
  289. }
  290. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  291. public static int Bool3InequalityWithScalar(ref bool3 a, bool b)
  292. {
  293. return Vectors.ConvertToInt(a != b);
  294. }
  295. // Int2
  296. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  297. public static bool Bool2Equals(ref bool2 a, ref bool2 b)
  298. {
  299. return a.Equals(b);
  300. }
  301. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  302. public static int Bool2Equality(ref bool2 a, ref bool2 b)
  303. {
  304. return Vectors.ConvertToInt(a == b);
  305. }
  306. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  307. public static int Bool2Inequality(ref bool2 a, ref bool2 b)
  308. {
  309. return Vectors.ConvertToInt(a != b);
  310. }
  311. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  312. public static int Bool2EqualityWithScalar(ref bool2 a, bool b)
  313. {
  314. return Vectors.ConvertToInt(a == b);
  315. }
  316. [TestCompiler(DataRange.Standard, DataRange.Standard)]
  317. public static int Bool2InequalityWithScalar(ref bool2 a, bool b)
  318. {
  319. return Vectors.ConvertToInt(a != b);
  320. }
  321. }
  322. }