暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808
  1. using System.Diagnostics;
  2. using System.Runtime.InteropServices;
  3. namespace Unity.Burst.Intrinsics
  4. {
  5. /// <summary>
  6. /// Represents a 128-bit SIMD value
  7. /// </summary>
  8. [StructLayout(LayoutKind.Explicit)]
  9. [DebuggerTypeProxy(typeof(V128DebugView))]
  10. public struct v128
  11. {
  12. /// <summary>
  13. /// Get the 0th Byte of the vector
  14. /// </summary>
  15. [FieldOffset(0)] public byte Byte0;
  16. /// <summary>
  17. /// Get the 1st Byte of the vector
  18. /// </summary>
  19. [FieldOffset(1)] public byte Byte1;
  20. /// <summary>
  21. /// Get the 2nd Byte of the vector
  22. /// </summary>
  23. [FieldOffset(2)] public byte Byte2;
  24. /// <summary>
  25. /// Get the 3rd Byte of the vector
  26. /// </summary>
  27. [FieldOffset(3)] public byte Byte3;
  28. /// <summary>
  29. /// Get the 4th Byte of the vector
  30. /// </summary>
  31. [FieldOffset(4)] public byte Byte4;
  32. /// <summary>
  33. /// Get the 5th Byte of the vector
  34. /// </summary>
  35. [FieldOffset(5)] public byte Byte5;
  36. /// <summary>
  37. /// Get the 6th Byte of the vector
  38. /// </summary>
  39. [FieldOffset(6)] public byte Byte6;
  40. /// <summary>
  41. /// Get the 7th Byte of the vector
  42. /// </summary>
  43. [FieldOffset(7)] public byte Byte7;
  44. /// <summary>
  45. /// Get the 8th Byte of the vector
  46. /// </summary>
  47. [FieldOffset(8)] public byte Byte8;
  48. /// <summary>
  49. /// Get the 9th Byte of the vector
  50. /// </summary>
  51. [FieldOffset(9)] public byte Byte9;
  52. /// <summary>
  53. /// Get the 10th Byte of the vector
  54. /// </summary>
  55. [FieldOffset(10)] public byte Byte10;
  56. /// <summary>
  57. /// Get the 11th Byte of the vector
  58. /// </summary>
  59. [FieldOffset(11)] public byte Byte11;
  60. /// <summary>
  61. /// Get the 12 Byte of the vector
  62. /// </summary>
  63. [FieldOffset(12)] public byte Byte12;
  64. /// <summary>
  65. /// Get the 13th Byte of the vector
  66. /// </summary>
  67. [FieldOffset(13)] public byte Byte13;
  68. /// <summary>
  69. /// Get the 14th Byte of the vector
  70. /// </summary>
  71. [FieldOffset(14)] public byte Byte14;
  72. /// <summary>
  73. /// Get the 15th Byte of the vector
  74. /// </summary>
  75. [FieldOffset(15)] public byte Byte15;
  76. /// <summary>
  77. /// Get the 0th SByte of the vector
  78. /// </summary>
  79. [FieldOffset(0)] public sbyte SByte0;
  80. /// <summary>
  81. /// Get the 1st SByte of the vector
  82. /// </summary>
  83. [FieldOffset(1)] public sbyte SByte1;
  84. /// <summary>
  85. /// Get the 2nd SByte of the vector
  86. /// </summary>
  87. [FieldOffset(2)] public sbyte SByte2;
  88. /// <summary>
  89. /// Get the 3rd SByte of the vector
  90. /// </summary>
  91. [FieldOffset(3)] public sbyte SByte3;
  92. /// <summary>
  93. /// Get the 4th SByte of the vector
  94. /// </summary>
  95. [FieldOffset(4)] public sbyte SByte4;
  96. /// <summary>
  97. /// Get the 5th SByte of the vector
  98. /// </summary>
  99. [FieldOffset(5)] public sbyte SByte5;
  100. /// <summary>
  101. /// Get the 6th SByte of the vector
  102. /// </summary>
  103. [FieldOffset(6)] public sbyte SByte6;
  104. /// <summary>
  105. /// Get the 7th SByte of the vector
  106. /// </summary>
  107. [FieldOffset(7)] public sbyte SByte7;
  108. /// <summary>
  109. /// Get the 8th SByte of the vector
  110. /// </summary>
  111. [FieldOffset(8)] public sbyte SByte8;
  112. /// <summary>
  113. /// Get the 9th SByte of the vector
  114. /// </summary>
  115. [FieldOffset(9)] public sbyte SByte9;
  116. /// <summary>
  117. /// Get the 10th SByte of the vector
  118. /// </summary>
  119. [FieldOffset(10)] public sbyte SByte10;
  120. /// <summary>
  121. /// Get the 11th SByte of the vector
  122. /// </summary>
  123. [FieldOffset(11)] public sbyte SByte11;
  124. /// <summary>
  125. /// Get the 12th SByte of the vector
  126. /// </summary>
  127. [FieldOffset(12)] public sbyte SByte12;
  128. /// <summary>
  129. /// Get the 13th SByte of the vector
  130. /// </summary>
  131. [FieldOffset(13)] public sbyte SByte13;
  132. /// <summary>
  133. /// Get the 14th SByte of the vector
  134. /// </summary>
  135. [FieldOffset(14)] public sbyte SByte14;
  136. /// <summary>
  137. /// Get the 15th SByte of the vector
  138. /// </summary>
  139. [FieldOffset(15)] public sbyte SByte15;
  140. /// <summary>
  141. /// Get the 0th UShort of the vector
  142. /// </summary>
  143. [FieldOffset(0)] public ushort UShort0;
  144. /// <summary>
  145. /// Get the 1st UShort of the vector
  146. /// </summary>
  147. [FieldOffset(2)] public ushort UShort1;
  148. /// <summary>
  149. /// Get the 2nd UShort of the vector
  150. /// </summary>
  151. [FieldOffset(4)] public ushort UShort2;
  152. /// <summary>
  153. /// Get the 3rd UShort of the vector
  154. /// </summary>
  155. [FieldOffset(6)] public ushort UShort3;
  156. /// <summary>
  157. /// Get the 4th UShort of the vector
  158. /// </summary>
  159. [FieldOffset(8)] public ushort UShort4;
  160. /// <summary>
  161. /// Get the 5th UShort of the vector
  162. /// </summary>
  163. [FieldOffset(10)] public ushort UShort5;
  164. /// <summary>
  165. /// Get the 6th UShort of the vector
  166. /// </summary>
  167. [FieldOffset(12)] public ushort UShort6;
  168. /// <summary>
  169. /// Get the 7th UShort of the vector
  170. /// </summary>
  171. [FieldOffset(14)] public ushort UShort7;
  172. /// <summary>
  173. /// Get the 0th SShort of the vector
  174. /// </summary>
  175. [FieldOffset(0)] public short SShort0;
  176. /// <summary>
  177. /// Get the 1st UShort of the vector
  178. /// </summary>
  179. [FieldOffset(2)] public short SShort1;
  180. /// <summary>
  181. /// Get the 2nd UShort of the vector
  182. /// </summary>
  183. [FieldOffset(4)] public short SShort2;
  184. /// <summary>
  185. /// Get the 3rd UShort of the vector
  186. /// </summary>
  187. [FieldOffset(6)] public short SShort3;
  188. /// <summary>
  189. /// Get the 4th UShort of the vector
  190. /// </summary>
  191. [FieldOffset(8)] public short SShort4;
  192. /// <summary>
  193. /// Get the 5th UShort of the vector
  194. /// </summary>
  195. [FieldOffset(10)] public short SShort5;
  196. /// <summary>
  197. /// Get the 6th UShort of the vector
  198. /// </summary>
  199. [FieldOffset(12)] public short SShort6;
  200. /// <summary>
  201. /// Get the 7th UShort of the vector
  202. /// </summary>
  203. [FieldOffset(14)] public short SShort7;
  204. #if BURST_INTERNAL || UNITY_BURST_EXPERIMENTAL_NEON_INTRINSICS
  205. /// <summary>
  206. /// Get the 0th f16 of the vector
  207. /// </summary>
  208. [FieldOffset(0)] public f16 Half0;
  209. /// <summary>
  210. /// Get the 1st f16 of the vector
  211. /// </summary>
  212. [FieldOffset(2)] public f16 Half1;
  213. /// <summary>
  214. /// Get the 2nd f16 of the vector
  215. /// </summary>
  216. [FieldOffset(4)] public f16 Half2;
  217. /// <summary>
  218. /// Get the 3rd f16 of the vector
  219. /// </summary>
  220. [FieldOffset(6)] public f16 Half3;
  221. /// <summary>
  222. /// Get the 4th f16 of the vector
  223. /// </summary>
  224. [FieldOffset(8)] public f16 Half4;
  225. /// <summary>
  226. /// Get the 5th f16 of the vector
  227. /// </summary>
  228. [FieldOffset(10)] public f16 Half5;
  229. /// <summary>
  230. /// Get the 6th f16 of the vector
  231. /// </summary>
  232. [FieldOffset(12)] public f16 Half6;
  233. /// <summary>
  234. /// Get the 7th f16 of the vector
  235. /// </summary>
  236. [FieldOffset(14)] public f16 Half7;
  237. #endif // BURST_INTERNAL || UNITY_BURST_EXPERIMENTAL_NEON_INTRINSICS
  238. /// <summary>
  239. /// Get the 0th UInt of the vector
  240. /// </summary>
  241. [FieldOffset(0)] public uint UInt0;
  242. /// <summary>
  243. /// Get the 1st UInt of the vector
  244. /// </summary>
  245. [FieldOffset(4)] public uint UInt1;
  246. /// <summary>
  247. /// Get the 2nd UInt of the vector
  248. /// </summary>
  249. [FieldOffset(8)] public uint UInt2;
  250. /// <summary>
  251. /// Get the 3rd UInt of the vector
  252. /// </summary>
  253. [FieldOffset(12)] public uint UInt3;
  254. /// <summary>
  255. /// Get the 0th SInt of the vector
  256. /// </summary>
  257. [FieldOffset(0)] public int SInt0;
  258. /// <summary>
  259. /// Get the 1st SInt of the vector
  260. /// </summary>
  261. [FieldOffset(4)] public int SInt1;
  262. /// <summary>
  263. /// Get the 2nd SInt of the vector
  264. /// </summary>
  265. [FieldOffset(8)] public int SInt2;
  266. /// <summary>
  267. /// Get the 3rd SInt of the vector
  268. /// </summary>
  269. [FieldOffset(12)] public int SInt3;
  270. /// <summary>
  271. /// Get the 0th ULong of the vector
  272. /// </summary>
  273. [FieldOffset(0)] public ulong ULong0;
  274. /// <summary>
  275. /// Get the 1st ULong of the vector
  276. /// </summary>
  277. [FieldOffset(8)] public ulong ULong1;
  278. /// <summary>
  279. /// Get the 0th SLong of the vector
  280. /// </summary>
  281. [FieldOffset(0)] public long SLong0;
  282. /// <summary>
  283. /// Get the 1st SLong of the vector
  284. /// </summary>
  285. [FieldOffset(8)] public long SLong1;
  286. /// <summary>
  287. /// Get the 0th Float of the vector
  288. /// </summary>
  289. [FieldOffset(0)] public float Float0;
  290. /// <summary>
  291. /// Get the 1st Float of the vector
  292. /// </summary>
  293. [FieldOffset(4)] public float Float1;
  294. /// <summary>
  295. /// Get the 2nd Float of the vector
  296. /// </summary>
  297. [FieldOffset(8)] public float Float2;
  298. /// <summary>
  299. /// Get the 3rd Float of the vector
  300. /// </summary>
  301. [FieldOffset(12)] public float Float3;
  302. /// <summary>
  303. /// Get the 0th Double of the vector
  304. /// </summary>
  305. [FieldOffset(0)] public double Double0;
  306. /// <summary>
  307. /// Get the 1st Double of the vector
  308. /// </summary>
  309. [FieldOffset(8)] public double Double1;
  310. /// <summary>
  311. /// Get the low half of the vector
  312. /// </summary>
  313. [FieldOffset(0)] public v64 Lo64;
  314. /// <summary>
  315. /// Get the high half of the vector
  316. /// </summary>
  317. [FieldOffset(8)] public v64 Hi64;
  318. /// <summary>
  319. /// Splat a single byte across the v128
  320. /// </summary>
  321. /// <param name="b">Splatted byte.</param>
  322. public v128(byte b)
  323. {
  324. this = default(v128);
  325. Byte0 = Byte1 = Byte2 = Byte3 = Byte4 = Byte5 = Byte6 = Byte7 = Byte8 = Byte9 = Byte10 = Byte11 = Byte12 = Byte13 = Byte14 = Byte15 = b;
  326. }
  327. /// <summary>
  328. /// Initialize the v128 with 16 bytes
  329. /// </summary>
  330. /// <param name="a">byte a.</param>
  331. /// <param name="b">byte b.</param>
  332. /// <param name="c">byte c.</param>
  333. /// <param name="d">byte d.</param>
  334. /// <param name="e">byte e.</param>
  335. /// <param name="f">byte f.</param>
  336. /// <param name="g">byte g.</param>
  337. /// <param name="h">byte h.</param>
  338. /// <param name="i">byte i.</param>
  339. /// <param name="j">byte j.</param>
  340. /// <param name="k">byte k.</param>
  341. /// <param name="l">byte l.</param>
  342. /// <param name="m">byte m.</param>
  343. /// <param name="n">byte n.</param>
  344. /// <param name="o">byte o.</param>
  345. /// <param name="p">byte p.</param>
  346. public v128(
  347. byte a, byte b, byte c, byte d,
  348. byte e, byte f, byte g, byte h,
  349. byte i, byte j, byte k, byte l,
  350. byte m, byte n, byte o, byte p)
  351. {
  352. this = default(v128);
  353. Byte0 = a;
  354. Byte1 = b;
  355. Byte2 = c;
  356. Byte3 = d;
  357. Byte4 = e;
  358. Byte5 = f;
  359. Byte6 = g;
  360. Byte7 = h;
  361. Byte8 = i;
  362. Byte9 = j;
  363. Byte10 = k;
  364. Byte11 = l;
  365. Byte12 = m;
  366. Byte13 = n;
  367. Byte14 = o;
  368. Byte15 = p;
  369. }
  370. /// <summary>
  371. /// Splat a single sbyte across the v128
  372. /// </summary>
  373. /// <param name="b">Splatted sbyte.</param>
  374. public v128(sbyte b)
  375. {
  376. this = default(v128);
  377. SByte0 = SByte1 = SByte2 = SByte3 = SByte4 = SByte5 = SByte6 = SByte7 = SByte8 = SByte9 = SByte10 = SByte11 = SByte12 = SByte13 = SByte14 = SByte15 = b;
  378. }
  379. /// <summary>
  380. /// Initialize the v128 with 16 sbytes
  381. /// </summary>
  382. /// <param name="a">sbyte a.</param>
  383. /// <param name="b">sbyte b.</param>
  384. /// <param name="c">sbyte c.</param>
  385. /// <param name="d">sbyte d.</param>
  386. /// <param name="e">sbyte e.</param>
  387. /// <param name="f">sbyte f.</param>
  388. /// <param name="g">sbyte g.</param>
  389. /// <param name="h">sbyte h.</param>
  390. /// <param name="i">sbyte i.</param>
  391. /// <param name="j">sbyte j.</param>
  392. /// <param name="k">sbyte k.</param>
  393. /// <param name="l">sbyte l.</param>
  394. /// <param name="m">sbyte m.</param>
  395. /// <param name="n">sbyte n.</param>
  396. /// <param name="o">sbyte o.</param>
  397. /// <param name="p">sbyte p.</param>
  398. public v128(
  399. sbyte a, sbyte b, sbyte c, sbyte d,
  400. sbyte e, sbyte f, sbyte g, sbyte h,
  401. sbyte i, sbyte j, sbyte k, sbyte l,
  402. sbyte m, sbyte n, sbyte o, sbyte p)
  403. {
  404. this = default(v128);
  405. SByte0 = a;
  406. SByte1 = b;
  407. SByte2 = c;
  408. SByte3 = d;
  409. SByte4 = e;
  410. SByte5 = f;
  411. SByte6 = g;
  412. SByte7 = h;
  413. SByte8 = i;
  414. SByte9 = j;
  415. SByte10 = k;
  416. SByte11 = l;
  417. SByte12 = m;
  418. SByte13 = n;
  419. SByte14 = o;
  420. SByte15 = p;
  421. }
  422. /// <summary>
  423. /// Splat a single short across the v128
  424. /// </summary>
  425. /// <param name="v">Splatted short.</param>
  426. public v128(short v)
  427. {
  428. this = default(v128);
  429. SShort0 = SShort1 = SShort2 = SShort3 = SShort4 = SShort5 = SShort6 = SShort7 = v;
  430. }
  431. /// <summary>
  432. /// Initialize the v128 with 8 shorts
  433. /// </summary>
  434. /// <param name="a">short a.</param>
  435. /// <param name="b">short b.</param>
  436. /// <param name="c">short c.</param>
  437. /// <param name="d">short d.</param>
  438. /// <param name="e">short e.</param>
  439. /// <param name="f">short f.</param>
  440. /// <param name="g">short g.</param>
  441. /// <param name="h">short h.</param>
  442. public v128(short a, short b, short c, short d, short e, short f, short g, short h)
  443. {
  444. this = default(v128);
  445. SShort0 = a;
  446. SShort1 = b;
  447. SShort2 = c;
  448. SShort3 = d;
  449. SShort4 = e;
  450. SShort5 = f;
  451. SShort6 = g;
  452. SShort7 = h;
  453. }
  454. /// <summary>
  455. /// Splat a single ushort across the v128
  456. /// </summary>
  457. /// <param name="v">Splatted ushort.</param>
  458. public v128(ushort v)
  459. {
  460. this = default(v128);
  461. UShort0 = UShort1 = UShort2 = UShort3 = UShort4 = UShort5 = UShort6 = UShort7 = v;
  462. }
  463. /// <summary>
  464. /// Initialize the v128 with 8 ushorts
  465. /// </summary>
  466. /// <param name="a">ushort a.</param>
  467. /// <param name="b">ushort b.</param>
  468. /// <param name="c">ushort c.</param>
  469. /// <param name="d">ushort d.</param>
  470. /// <param name="e">ushort e.</param>
  471. /// <param name="f">ushort f.</param>
  472. /// <param name="g">ushort g.</param>
  473. /// <param name="h">ushort h.</param>
  474. public v128(ushort a, ushort b, ushort c, ushort d, ushort e, ushort f, ushort g, ushort h)
  475. {
  476. this = default(v128);
  477. UShort0 = a;
  478. UShort1 = b;
  479. UShort2 = c;
  480. UShort3 = d;
  481. UShort4 = e;
  482. UShort5 = f;
  483. UShort6 = g;
  484. UShort7 = h;
  485. }
  486. #if BURST_INTERNAL || UNITY_BURST_EXPERIMENTAL_NEON_INTRINSICS
  487. /// <summary>
  488. /// Splat a single f16 across the v128
  489. /// </summary>
  490. /// <param name="v">Splatted f16.</param>
  491. public v128(f16 v)
  492. {
  493. this = default(v128);
  494. Half0 = Half1 = Half2 = Half3 = Half4 = Half5 = Half6 = Half7 = v;
  495. }
  496. /// <summary>
  497. /// Initialize the v128 with 8 half's
  498. /// </summary>
  499. /// <param name="a">f16 a.</param>
  500. /// <param name="b">f16 b.</param>
  501. /// <param name="c">f16 c.</param>
  502. /// <param name="d">f16 d.</param>
  503. /// <param name="e">f16 e.</param>
  504. /// <param name="f">f16 f.</param>
  505. /// <param name="g">f16 g.</param>
  506. /// <param name="h">f16 h.</param>
  507. public v128(f16 a, f16 b, f16 c, f16 d, f16 e, f16 f, f16 g, f16 h)
  508. {
  509. this = default(v128);
  510. Half0 = a;
  511. Half1 = b;
  512. Half2 = c;
  513. Half3 = d;
  514. Half4 = e;
  515. Half5 = f;
  516. Half6 = g;
  517. Half7 = h;
  518. }
  519. #endif // BURST_INTERNAL || UNITY_BURST_EXPERIMENTAL_NEON_INTRINSICS
  520. /// <summary>
  521. /// Splat a single int across the v128
  522. /// </summary>
  523. /// <param name="v">Splatted int.</param>
  524. public v128(int v)
  525. {
  526. this = default(v128);
  527. SInt0 = SInt1 = SInt2 = SInt3 = v;
  528. }
  529. /// <summary>
  530. /// Initialize the v128 with 4 ints
  531. /// </summary>
  532. /// <param name="a">int a.</param>
  533. /// <param name="b">int b.</param>
  534. /// <param name="c">int c.</param>
  535. /// <param name="d">int d.</param>
  536. public v128(int a, int b, int c, int d)
  537. {
  538. this = default(v128);
  539. SInt0 = a;
  540. SInt1 = b;
  541. SInt2 = c;
  542. SInt3 = d;
  543. }
  544. /// <summary>
  545. /// Splat a single uint across the v128
  546. /// </summary>
  547. /// <param name="v">Splatted uint.</param>
  548. public v128(uint v)
  549. {
  550. this = default(v128);
  551. UInt0 = UInt1 = UInt2 = UInt3 = v;
  552. }
  553. /// <summary>
  554. /// Initialize the v128 with 4 uints
  555. /// </summary>
  556. /// <param name="a">uint a.</param>
  557. /// <param name="b">uint b.</param>
  558. /// <param name="c">uint c.</param>
  559. /// <param name="d">uint d.</param>
  560. public v128(uint a, uint b, uint c, uint d)
  561. {
  562. this = default(v128);
  563. UInt0 = a;
  564. UInt1 = b;
  565. UInt2 = c;
  566. UInt3 = d;
  567. }
  568. /// <summary>
  569. /// Splat a single float across the v128
  570. /// </summary>
  571. /// <param name="f">Splatted float.</param>
  572. public v128(float f)
  573. {
  574. this = default(v128);
  575. Float0 = Float1 = Float2 = Float3 = f;
  576. }
  577. /// <summary>
  578. /// Initialize the v128 with 4 floats
  579. /// </summary>
  580. /// <param name="a">float a.</param>
  581. /// <param name="b">float b.</param>
  582. /// <param name="c">float c.</param>
  583. /// <param name="d">float d.</param>
  584. public v128(float a, float b, float c, float d)
  585. {
  586. this = default(v128);
  587. Float0 = a;
  588. Float1 = b;
  589. Float2 = c;
  590. Float3 = d;
  591. }
  592. /// <summary>
  593. /// Splat a single double across the v128
  594. /// </summary>
  595. /// <param name="f">Splatted double.</param>
  596. public v128(double f)
  597. {
  598. this = default(v128);
  599. Double0 = Double1 = f;
  600. }
  601. /// <summary>
  602. /// Initialize the v128 with 2 doubles
  603. /// </summary>
  604. /// <param name="a">double a.</param>
  605. /// <param name="b">double b.</param>
  606. public v128(double a, double b)
  607. {
  608. this = default(v128);
  609. Double0 = a;
  610. Double1 = b;
  611. }
  612. /// <summary>
  613. /// Splat a single long across the v128
  614. /// </summary>
  615. /// <param name="f">Splatted long.</param>
  616. public v128(long f)
  617. {
  618. this = default(v128);
  619. SLong0 = SLong1 = f;
  620. }
  621. /// <summary>
  622. /// Initialize the v128 with 2 longs
  623. /// </summary>
  624. /// <param name="a">long a.</param>
  625. /// <param name="b">long b.</param>
  626. public v128(long a, long b)
  627. {
  628. this = default(v128);
  629. SLong0 = a;
  630. SLong1 = b;
  631. }
  632. /// <summary>
  633. /// Splat a single ulong across the v128
  634. /// </summary>
  635. /// <param name="f">Splatted ulong.</param>
  636. public v128(ulong f)
  637. {
  638. this = default(v128);
  639. ULong0 = ULong1 = f;
  640. }
  641. /// <summary>
  642. /// Initialize the v128 with 2 ulongs
  643. /// </summary>
  644. /// <param name="a">ulong a.</param>
  645. /// <param name="b">ulong b.</param>
  646. public v128(ulong a, ulong b)
  647. {
  648. this = default(v128);
  649. ULong0 = a;
  650. ULong1 = b;
  651. }
  652. /// <summary>
  653. /// Initialize the v128 with 2 v64's
  654. /// </summary>
  655. /// <param name="lo">Low half of v64.</param>
  656. /// <param name="hi">High half of v64.</param>
  657. public v128(v64 lo, v64 hi)
  658. {
  659. this = default(v128);
  660. Lo64 = lo;
  661. Hi64 = hi;
  662. }
  663. }
  664. #if BURST_INTERNAL || UNITY_BURST_EXPERIMENTAL_NEON_INTRINSICS
  665. /// <summary>
  666. /// Represents a 256-bit SIMD value (Arm only)
  667. /// (a combination of 2 128-bit values, equivalent to Arm Neon *x2 types)
  668. /// </summary>
  669. [StructLayout(LayoutKind.Explicit)]
  670. public struct v128x2
  671. {
  672. /// <summary>
  673. /// Get the first 128 bits of the vector
  674. /// </summary>
  675. [FieldOffset(0)] public v128 v128_0;
  676. /// <summary>
  677. /// Get the second 128 bits of the vector
  678. /// </summary>
  679. [FieldOffset(16)] public v128 v128_1;
  680. /// <summary>
  681. /// Initialize the v128x2 with 2 v128's
  682. /// </summary>
  683. /// <param name="v0">First v128.</param>
  684. /// <param name="v1">Second v128.</param>
  685. public v128x2(v128 v0, v128 v1)
  686. {
  687. this = default(v128x2);
  688. v128_0 = v0;
  689. v128_1 = v1;
  690. }
  691. }
  692. /// <summary>
  693. /// Represents a 384-bit SIMD value (Arm only)
  694. /// (a combination of 3 128-bit values, equivalent to Arm Neon *x3 types)
  695. /// </summary>
  696. [StructLayout(LayoutKind.Explicit)]
  697. public struct v128x3
  698. {
  699. /// <summary>
  700. /// Get the first 128 bits of the vector
  701. /// </summary>
  702. [FieldOffset(0)] public v128 v128_0;
  703. /// <summary>
  704. /// Get the second 128 bits of the vector
  705. /// </summary>
  706. [FieldOffset(16)] public v128 v128_1;
  707. /// <summary>
  708. /// Get the third 128 bits of the vector
  709. /// </summary>
  710. [FieldOffset(32)] public v128 v128_2;
  711. /// <summary>
  712. /// Initialize the v128x3 with 3 v128's
  713. /// </summary>
  714. /// <param name="v0">First v128.</param>
  715. /// <param name="v1">Second v128.</param>
  716. /// <param name="v2">Third v128.</param>
  717. public v128x3(v128 v0, v128 v1, v128 v2)
  718. {
  719. this = default(v128x3);
  720. v128_0 = v0;
  721. v128_1 = v1;
  722. v128_2 = v2;
  723. }
  724. }
  725. /// <summary>
  726. /// Represents a 512-bit SIMD value (Arm only)
  727. /// (a combination of 4 128-bit values, equivalent to Arm Neon *x4 types)
  728. /// </summary>
  729. [StructLayout(LayoutKind.Explicit)]
  730. public struct v128x4
  731. {
  732. /// <summary>
  733. /// Get the first 128 bits of the vector
  734. /// </summary>
  735. [FieldOffset(0)] public v128 v128_0;
  736. /// <summary>
  737. /// Get the second 128 bits of the vector
  738. /// </summary>
  739. [FieldOffset(16)] public v128 v128_1;
  740. /// <summary>
  741. /// Get the third 128 bits of the vector
  742. /// </summary>
  743. [FieldOffset(32)] public v128 v128_2;
  744. /// <summary>
  745. /// Get the fourth 128 bits of the vector
  746. /// </summary>
  747. [FieldOffset(48)] public v128 v128_3;
  748. /// <summary>
  749. /// Initialize the v128x4 with 4 v128's
  750. /// </summary>
  751. /// <param name="v0">First v128.</param>
  752. /// <param name="v1">Second v128.</param>
  753. /// <param name="v2">Third v128.</param>
  754. /// <param name="v3">Fourth v128.</param>
  755. public v128x4(v128 v0, v128 v1, v128 v2, v128 v3)
  756. {
  757. this = default(v128x4);
  758. v128_0 = v0;
  759. v128_1 = v1;
  760. v128_2 = v2;
  761. v128_3 = v3;
  762. }
  763. }
  764. #endif // BURST_INTERNAL || UNITY_BURST_EXPERIMENTAL_NEON_INTRINSICS
  765. }