comparisonTests.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft Corporation and contributors. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. let passed = true;
  6. const OPS = Object.freeze({
  7. EQ : 0,
  8. NE : 1,
  9. LT : 2,
  10. LE : 3,
  11. GT : 4,
  12. GE : 5
  13. });
  14. function assertEquals(expected, actual) {
  15. if (expected != actual) {
  16. passed = false;
  17. throw `Expected ${expected}, received ${actual}`;
  18. }
  19. }
  20. const INITIAL_SIZE = 1;
  21. const memObj = new WebAssembly.Memory({initial:INITIAL_SIZE});
  22. const module = new WebAssembly.Module(readbuffer('comp.wasm'));
  23. const instance = new WebAssembly.Instance(module, { "dummy" : { "memory" : memObj } }).exports;
  24. const arrays = {
  25. "i32x4" : new Int32Array (memObj.buffer),
  26. "i16x8" : new Int16Array (memObj.buffer),
  27. "i8x16" : new Int8Array (memObj.buffer),
  28. "f32x4" : new Float32Array (memObj.buffer),
  29. "f64x2" : new Float64Array (memObj.buffer)
  30. };
  31. function moveArgsIntoArray(args, offset, arr) {
  32. for (let i = 0; i < args.length; i++) {
  33. arr[offset + i] = args[i];
  34. }
  35. }
  36. let testCompOps = function (funcname, args1, args2, op, resultArr) {
  37. const len = args1.length;
  38. const arr = arrays[funcname.split('_')[1]];
  39. moveArgsIntoArray(args1, 0, arr);
  40. moveArgsIntoArray(args2, len, arr);
  41. instance[funcname](op);
  42. for (let i = 0; i < len; i++) {
  43. assertEquals(resultArr[i], Number.isNaN(arr[i]) || !!arr[i]);
  44. }
  45. }
  46. testCompOps("func_i32x4_compare_s",
  47. [2147483647,0,-100,-2147483648],
  48. [2147483647,45,202,-2147483648],
  49. OPS.EQ,
  50. [1,0,0,1]
  51. );
  52. testCompOps("func_i32x4_compare_s",
  53. [277,2147483647,-100,2147483647],
  54. [431,2147483647,555,2147483647],
  55. OPS.EQ,
  56. [0,1,0,1]
  57. );
  58. testCompOps("func_i32x4_compare_s",
  59. [2147483647,0,-100,-2147483648],
  60. [2147483647,45,202,-2147483648],
  61. OPS.NE,
  62. [0,1,1,0]
  63. );
  64. testCompOps("func_i32x4_compare_s",
  65. [277,2147483647,-100,2147483647],
  66. [431,2147483647,555,2147483647],
  67. OPS.NE,
  68. [1,0,1,0]
  69. );
  70. testCompOps("func_i32x4_compare_s",
  71. [-1,1440,2100,-2147483648],
  72. [2147483647,45,202,4],
  73. OPS.LT,
  74. [1,0,0,1]
  75. );
  76. testCompOps("func_i32x4_compare_s",
  77. [431,-2147483646,555,21474836],
  78. [277,2147483647,-100,2147483647],
  79. OPS.LT,
  80. [0,1,0,1]
  81. );
  82. testCompOps("func_i32x4_compare_s",
  83. [2147483647,1440,2100,4],
  84. [2147483647,45,202,4],
  85. OPS.LE,
  86. [1,0,0,1]
  87. );
  88. testCompOps("func_i32x4_compare_s",
  89. [431,-2147483646,555,21474835],
  90. [277,-2147483646,-100,21474836],
  91. OPS.LE,
  92. [0,1,0,1]
  93. );
  94. testCompOps("func_i32x4_compare_s",
  95. [-1,1440,2100,-2147483648],
  96. [2147483647,45,202,4],
  97. OPS.GT,
  98. [0,1,1,0]
  99. );
  100. testCompOps("func_i32x4_compare_s",
  101. [431,-2147483646,555,21474836],
  102. [277,2147483647,-100,2147483647],
  103. OPS.GT,
  104. [1,0,1,0]
  105. );
  106. testCompOps("func_i32x4_compare_s",
  107. [-1,1440,2100,-2147483648],
  108. [2147483647,1440,202,4],
  109. OPS.GE,
  110. [0,1,1,0]
  111. );
  112. testCompOps("func_i32x4_compare_s",
  113. [431,-2147483646,-100,21474836],
  114. [277,2147483647,-100,2147483647],
  115. OPS.GE,
  116. [1,0,1,0]
  117. );
  118. testCompOps("func_i32x4_compare_u",
  119. [2147483647,0,-100,-2147483648],
  120. [2147483647,45,202,-2147483648],
  121. OPS.EQ,
  122. [1,0,0,1]
  123. );
  124. testCompOps("func_i32x4_compare_u",
  125. [277,2147483647,-100,2147483647],
  126. [431,2147483647,555,2147483647],
  127. OPS.EQ,
  128. [0,1,0,1]
  129. );
  130. testCompOps("func_i32x4_compare_u",
  131. [2147483647,0,-100,-2147483648],
  132. [2147483647,45,202,-2147483648],
  133. OPS.NE,
  134. [0,1,1,0]
  135. );
  136. testCompOps("func_i32x4_compare_u",
  137. [277,2147483647,-100,2147483647],
  138. [431,2147483647,555,2147483647],
  139. OPS.NE,
  140. [1,0,1,0]
  141. );
  142. testCompOps("func_i32x4_compare_u",
  143. [-100,1440,2100,-2147483648],
  144. [-1,45,202,-2147483647],
  145. OPS.LT,
  146. [1,0,0,1]
  147. );
  148. testCompOps("func_i32x4_compare_u",
  149. [431,2147483646,555,21474836],
  150. [277,-2147483647,100,2147483647],
  151. OPS.LT,
  152. [0,1,0,1]
  153. );
  154. testCompOps("func_i32x4_compare_u",
  155. [2147483647,1440,2100,4],
  156. [2147483647,45,202,4],
  157. OPS.LE,
  158. [1,0,0,1]
  159. );
  160. testCompOps("func_i32x4_compare_u",
  161. [431,-2147483646,-555,21474835],
  162. [277,-2147483646,100,21474836],
  163. OPS.LE,
  164. [0,1,0,1]
  165. );
  166. testCompOps("func_i32x4_compare_u",
  167. [2147483647,1440,2100,2147483647],
  168. [-1,45,202,-4],
  169. OPS.GT,
  170. [0,1,1,0]
  171. );
  172. testCompOps("func_i32x4_compare_u",
  173. [431,2147483646,555,21474836],
  174. [277,-2147483647,100,2147483647],
  175. OPS.GT,
  176. [1,0,1,0]
  177. );
  178. testCompOps("func_i32x4_compare_u",
  179. [1,1440,2100,2147483648],
  180. [-2147483647,1440,202,-4],
  181. OPS.GE,
  182. [0,1,1,0]
  183. );
  184. testCompOps("func_i32x4_compare_u",
  185. [431,2147483646,-100,21474836],
  186. [277,-2147483647,-100,2147483647],
  187. OPS.GE,
  188. [1,0,1,0]
  189. );
  190. testCompOps("func_i16x8_compare_s",
  191. [65535,0,-100,-777,4,2,207,-65536],
  192. [65535,0,-123,-777,3,1,202,-65536],
  193. OPS.EQ,
  194. [1,1,0,1,0,0,0,1]
  195. );
  196. testCompOps("func_i16x8_compare_s",
  197. [11,2147483647,-200,2147483647,431,2147483647,555,2147483647],
  198. [277,2147483647,-100,2147483647,432,2147483647,755,2147483647],
  199. OPS.EQ,
  200. [0,1,0,1,0,1,0,1]
  201. );
  202. testCompOps("func_i16x8_compare_s",
  203. [65535,0,-100,-777,4,2,207,-65536],
  204. [65535,0,-123,-777,3,1,202,-65536],
  205. OPS.NE,
  206. [0,0,1,0,1,1,1,0]
  207. );
  208. testCompOps("func_i16x8_compare_s",
  209. [11,2147483647,-200,2147483647,431,2147483647,555,2147483647],
  210. [277,2147483647,-100,2147483647,432,2147483647,755,2147483647],
  211. OPS.NE,
  212. [1,0,1,0,1,0,1,0]
  213. );
  214. testCompOps("func_i16x8_compare_s",
  215. [32766,-1,-100,-778,4,2,207,-32768],
  216. [32767,0,-123,-777,3,1,202,-32767],
  217. OPS.LT,
  218. [1,1,0,1,0,0,0,1]
  219. );
  220. testCompOps("func_i16x8_compare_s",
  221. [1111,32766,-99,32765,1001,1,855,-32768],
  222. [277,32767,-100,32766,432,2,755,-32767],
  223. OPS.LT,
  224. [0,1,0,1,0,1,0,1]
  225. );
  226. testCompOps("func_i16x8_compare_s",
  227. [32767,-1,-100,-778,4,2,207,-32768],
  228. [32767,-1,-123,-777,3,1,202,-32767],
  229. OPS.LE,
  230. [1,1,0,1,0,0,0,1]
  231. );
  232. testCompOps("func_i16x8_compare_s",
  233. [1111,32766,-99,32765,1001,1,855,-32768],
  234. [277,32767,-100,32766,432,2,855,-32767],
  235. OPS.LE,
  236. [0,1,0,1,0,1,1,1]
  237. );
  238. testCompOps("func_i16x8_compare_s",
  239. [32766,-1,-100,-778,4,2,207,-32768],
  240. [32767,0,-123,-777,3,1,202,-32767],
  241. OPS.GT,
  242. [0,0,1,0,1,1,1,0]
  243. );
  244. testCompOps("func_i16x8_compare_s",
  245. [1111,32766,-99,32765,1001,1,855,-32768],
  246. [277,32767,-100,32766,432,2,755,-32767],
  247. OPS.GT,
  248. [1,0,1,0,1,0,1,0]
  249. );
  250. testCompOps("func_i16x8_compare_s",
  251. [32767,-1,-100,-778,4,2,207,-32768],
  252. [32767,-1,-123,-777,3,1,202,-32767],
  253. OPS.GE,
  254. [1,1,1,0,1,1,1,0]
  255. );
  256. testCompOps("func_i16x8_compare_s",
  257. [1111,32766,-99,32765,1001,1,855,-32768],
  258. [277,32767,-100,32766,432,2,855,-32767],
  259. OPS.GE,
  260. [1,0,1,0,1,0,1,0]
  261. );
  262. testCompOps("func_i16x8_compare_u",
  263. [65534,32766,129,0,4,2,207,65530],
  264. [65535,32767,123,1,3,1,202,65531],
  265. OPS.LT,
  266. [1,1,0,1,0,0,0,1]
  267. );
  268. testCompOps("func_i16x8_compare_u",
  269. [1111,32766,65535,32765,1001,1,855,32767],
  270. [277,32767,65531,32766,432,2,755,32768],
  271. OPS.LT,
  272. [0,1,0,1,0,1,0,1]
  273. );
  274. testCompOps("func_i16x8_compare_u",
  275. [65535,32766,129,0,4,2,207,65530],
  276. [65535,32767,123,1,3,1,202,65531],
  277. OPS.LE,
  278. [1,1,0,1,0,0,0,1]
  279. );
  280. testCompOps("func_i16x8_compare_u",
  281. [1111,32766,65535,32765,1001,1,855,32767],
  282. [277,32767,65531,32766,432,2,855,32768],
  283. OPS.LE,
  284. [0,1,0,1,0,1,1,1]
  285. );
  286. testCompOps("func_i16x8_compare_u",
  287. [65534,32766,129,0,4,2,207,65530],
  288. [65535,32767,123,1,3,1,202,65531],
  289. OPS.GT,
  290. [0,0,1,0,1,1,1,0]
  291. );
  292. testCompOps("func_i16x8_compare_u",
  293. [1111,32766,65535,32765,1001,1,855,32767],
  294. [277,32767,65531,32766,432,2,755,32768],
  295. OPS.GT,
  296. [1,0,1,0,1,0,1,0]
  297. );
  298. testCompOps("func_i16x8_compare_u",
  299. [65535,32767,129,0,4,2,207,65530],
  300. [65535,32766,123,1,3,1,202,65531],
  301. OPS.GE,
  302. [1,1,1,0,1,1,1,0]
  303. );
  304. testCompOps("func_i16x8_compare_u",
  305. [1111,32766,65535,32765,1001,1,855,32767],
  306. [277,32767,65531,32766,432,2,855,32768],
  307. OPS.GE,
  308. [1,0,1,0,1,0,1,0]
  309. );
  310. testCompOps("func_i16x8_compare_s",
  311. [255,0,-100,-77,4,2,207,-1],
  312. [255,0,-123,-77,3,1,202,-1],
  313. OPS.EQ,
  314. [1,1,0,1,0,0,0,1]
  315. );
  316. testCompOps("func_i16x8_compare_s",
  317. [11,127,-111,127,43,127,55,127],
  318. [12,127,-100,127,42,127,75,127],
  319. OPS.EQ,
  320. [0,1,0,1,0,1,0,1]
  321. );
  322. testCompOps("func_i16x8_compare_s",
  323. [255,0,-100,-77,4,2,207,-1],
  324. [255,0,-123,-77,3,1,202,-1],
  325. OPS.NE,
  326. [0,0,1,0,1,1,1,0]
  327. );
  328. testCompOps("func_i16x8_compare_s",
  329. [11,127,-111,127,431,127,555,127],
  330. [12,127,-100,127,432,127,755,127],
  331. OPS.NE,
  332. [1,0,1,0,1,0,1,0]
  333. );
  334. testCompOps("func_i16x8_compare_s",
  335. [126,-1,-100,-78,4,2,27,-128],
  336. [127,0,-123,-77,3,1,22,-127],
  337. OPS.LT,
  338. [1,1,0,1,0,0,0,1]
  339. );
  340. testCompOps("func_i16x8_compare_s",
  341. [111,126,-99,64,101,1,85,-128],
  342. [12,127,-100,126,43,2,75,-127],
  343. OPS.LT,
  344. [0,1,0,1,0,1,0,1]
  345. );
  346. testCompOps("func_i16x8_compare_s",
  347. [127,-1,-100,-78,4,2,27,-128],
  348. [127,-1,-123,-77,3,1,22,-127],
  349. OPS.LE,
  350. [1,1,0,1,0,0,0,1]
  351. );
  352. testCompOps("func_i16x8_compare_s",
  353. [111,126,-99,64,101,1,85,-128],
  354. [12,127,-100,126,43,2,85,-127],
  355. OPS.LE,
  356. [0,1,0,1,0,1,1,1]
  357. );
  358. testCompOps("func_i16x8_compare_s",
  359. [126,-1,-100,-78,4,2,27,-128],
  360. [127,0,-123,-77,3,1,22,-127],
  361. OPS.GT,
  362. [0,0,1,0,1,1,1,0]
  363. );
  364. testCompOps("func_i16x8_compare_s",
  365. [111,126,-99,64,101,1,85,-128],
  366. [12,127,-100,126,43,2,75,-127],
  367. OPS.GT,
  368. [1,0,1,0,1,0,1,0]
  369. );
  370. testCompOps("func_i16x8_compare_s",
  371. [127,-1,-100,-78,4,2,27,-128],
  372. [127,-1,-123,-77,3,1,22,-127],
  373. OPS.GE,
  374. [1,1,1,0,1,1,1,0]
  375. );
  376. testCompOps("func_i16x8_compare_s",
  377. [111,126,-99,64,101,1,85,-128],
  378. [12,127,-100,126,42,2,85,-127],
  379. OPS.GE,
  380. [1,0,1,0,1,0,1,0]
  381. );
  382. testCompOps("func_i16x8_compare_u",
  383. [253,126,129,0,4,2,207,63],
  384. [255,127,123,1,3,1,202,65],
  385. OPS.LT,
  386. [1,1,0,1,0,0,0,1]
  387. );
  388. testCompOps("func_i16x8_compare_u",
  389. [111,126,255,64,101,1,85,127],
  390. [12,127,65,126,43,2,75,128],
  391. OPS.LT,
  392. [0,1,0,1,0,1,0,1]
  393. );
  394. testCompOps("func_i16x8_compare_u",
  395. [255,126,129,0,4,2,207,63],
  396. [255,127,123,1,3,1,202,65],
  397. OPS.LE,
  398. [1,1,0,1,0,0,0,1]
  399. );
  400. testCompOps("func_i16x8_compare_u",
  401. [111,126,255,64,101,1,85,127],
  402. [12,127,65,126,43,2,85,128],
  403. OPS.LE,
  404. [0,1,0,1,0,1,1,1]
  405. );
  406. testCompOps("func_i16x8_compare_u",
  407. [253,126,129,0,4,2,207,63],
  408. [255,127,123,1,3,1,202,65],
  409. OPS.GT,
  410. [0,0,1,0,1,1,1,0]
  411. );
  412. testCompOps("func_i16x8_compare_u",
  413. [111,126,255,64,101,1,85,127],
  414. [12,127,200,126,43,2,75,128],
  415. OPS.GT,
  416. [1,0,1,0,1,0,1,0]
  417. );
  418. testCompOps("func_i16x8_compare_u",
  419. [255,127,129,0,4,2,207,63],
  420. [255,126,123,1,3,1,202,65],
  421. OPS.GE,
  422. [1,1,1,0,1,1,1,0]
  423. );
  424. testCompOps("func_i16x8_compare_u",
  425. [111,126,255,64,101,1,85,127],
  426. [12,127,200,126,43,2,85,128],
  427. OPS.GE,
  428. [1,0,1,0,1,0,1,0]
  429. );
  430. testCompOps("func_f32x4_compare",
  431. [1234.5,0,NaN,-567.25],
  432. [1234.5,45,202,-567.25],
  433. OPS.EQ,
  434. [1,0,0,1]
  435. );
  436. testCompOps("func_f32x4_compare",
  437. [277,1234.5,-100,1234.5],
  438. [431,1234.5,NaN,1234.5],
  439. OPS.EQ,
  440. [0,1,0,1]
  441. );
  442. testCompOps("func_f32x4_compare",
  443. [1234.5,0,-100,-567.25],
  444. [1234.5,45,NaN,-567.25],
  445. OPS.NE,
  446. [0,1,1,0]
  447. );
  448. testCompOps("func_f32x4_compare",
  449. [277,1234.5,-100,1234.5],
  450. [431,1234.5,NaN,1234.5],
  451. OPS.NE,
  452. [1,0,1,0]
  453. );
  454. testCompOps("func_f32x4_compare",
  455. [-1,1440,2100,-567.25],
  456. [1234.5,45,202,4],
  457. OPS.LT,
  458. [1,0,0,1]
  459. );
  460. testCompOps("func_f32x4_compare",
  461. [431,-2147483646,555,1234.1],
  462. [277,1234.5,-100,1234.5],
  463. OPS.LT,
  464. [0,1,0,1]
  465. );
  466. testCompOps("func_f32x4_compare",
  467. [1234.5,1440,2100,4],
  468. [1234.5,45,202,4],
  469. OPS.LE,
  470. [1,0,0,1]
  471. );
  472. testCompOps("func_f32x4_compare",
  473. [431,-2147483646,555,21474835],
  474. [277,-2147483646,-100,21474836],
  475. OPS.LE,
  476. [0,1,0,1]
  477. );
  478. testCompOps("func_f32x4_compare",
  479. [-1,1440,2100,-567.25],
  480. [1234.5,45,202,4],
  481. OPS.GT,
  482. [0,1,1,0]
  483. );
  484. testCompOps("func_f32x4_compare",
  485. [431,-2147483646,555,1234.4],
  486. [277,1234.5,-100,1234.5],
  487. OPS.GT,
  488. [1,0,1,0]
  489. );
  490. testCompOps("func_f32x4_compare",
  491. [-1,1440,2100,-567.25],
  492. [1234.5,1440,202,4],
  493. OPS.GE,
  494. [0,1,1,0]
  495. );
  496. testCompOps("func_f32x4_compare",
  497. [431,-2147483646,-100,1234.4],
  498. [277,1234.5,-100,1234.5],
  499. OPS.GE,
  500. [1,0,1,0]
  501. );
  502. testCompOps("func_f64x2_compare",
  503. [1234.5,0],
  504. [1234.5,45],
  505. OPS.EQ,
  506. [1,0]
  507. );
  508. testCompOps("func_f64x2_compare",
  509. [NaN,-567.25],
  510. [202,-567.25],
  511. OPS.EQ,
  512. [0,1]
  513. );
  514. testCompOps("func_f64x2_compare",
  515. [277,1234.5],
  516. [431,1234.5],
  517. OPS.EQ,
  518. [0,1]
  519. );
  520. testCompOps("func_f64x2_compare",
  521. [-100,1234.5],
  522. [NaN,1234.5],
  523. OPS.EQ,
  524. [0,1]
  525. );
  526. testCompOps("func_f64x2_compare",
  527. [1234.5,0],
  528. [1234.5,45],
  529. OPS.NE,
  530. [0,1]
  531. );
  532. testCompOps("func_f64x2_compare",
  533. [-100,-567.25],
  534. [NaN,-567.25],
  535. OPS.NE,
  536. [1,0]
  537. );
  538. testCompOps("func_f64x2_compare",
  539. [277,1234.5],
  540. [431,1234.5],
  541. OPS.NE,
  542. [1,0]
  543. );
  544. testCompOps("func_f64x2_compare",
  545. [-100,1234.5],
  546. [NaN,1234.5],
  547. OPS.NE,
  548. [1,0]
  549. );
  550. testCompOps("func_f64x2_compare",
  551. [-1,1440],
  552. [1234.5,45],
  553. OPS.LT,
  554. [1,0]
  555. );
  556. testCompOps("func_f64x2_compare",
  557. [2100,-567.25],
  558. [202,4],
  559. OPS.LT,
  560. [0,1]
  561. );
  562. testCompOps("func_f64x2_compare",
  563. [431,-2147483646],
  564. [277,1234.5],
  565. OPS.LT,
  566. [0,1]
  567. );
  568. testCompOps("func_f64x2_compare",
  569. [555,1234.1],
  570. [-100,1234.5],
  571. OPS.LT,
  572. [0,1]
  573. );
  574. testCompOps("func_f64x2_compare",
  575. [1234.5,1440],
  576. [1234.5,45],
  577. OPS.LE,
  578. [1,0]
  579. );
  580. testCompOps("func_f64x2_compare",
  581. [2100,4],
  582. [202,4],
  583. OPS.LE,
  584. [0,1]
  585. );
  586. testCompOps("func_f64x2_compare",
  587. [431,-2147483646],
  588. [277,-2147483646],
  589. OPS.LE,
  590. [0,1]
  591. );
  592. testCompOps("func_f64x2_compare",
  593. [555,21474835],
  594. [-100,21474836],
  595. OPS.LE,
  596. [0,1]
  597. );
  598. testCompOps("func_f64x2_compare",
  599. [-1,1440],
  600. [1234.5,45],
  601. OPS.GT,
  602. [0,1]
  603. );
  604. testCompOps("func_f64x2_compare",
  605. [2100,-567.25],
  606. [202,4],
  607. OPS.GT,
  608. [1,0]
  609. );
  610. testCompOps("func_f64x2_compare",
  611. [431,-2147483646],
  612. [277,1234.5],
  613. OPS.GT,
  614. [1,0]
  615. );
  616. testCompOps("func_f64x2_compare",
  617. [555,1234.4],
  618. [-100,1234.5],
  619. OPS.GT,
  620. [1,0]
  621. );
  622. testCompOps("func_f64x2_compare",
  623. [-1,1440],
  624. [1234.5,1440],
  625. OPS.GE,
  626. [0,1]
  627. );
  628. testCompOps("func_f64x2_compare",
  629. [2100,-567.25],
  630. [202,4],
  631. OPS.GE,
  632. [1,0]
  633. );
  634. testCompOps("func_f64x2_compare",
  635. [-100,1234.4],
  636. [-100,1234.5],
  637. OPS.GE,
  638. [1,0]
  639. );
  640. testCompOps("func_f64x2_compare",
  641. [431,-2147483646],
  642. [277,1234.5],
  643. OPS.GE,
  644. [1,0]
  645. );
  646. if (passed) {
  647. print("Passed");
  648. }