int64.g 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. # This file is part of asmc, a bootstrapping OS with minimal seed
  2. # Copyright (C) 2018-2019 Giovanni Mascellani <gio@debian.org>
  3. # https://gitlab.com/giomasce/asmc
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version.
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. $_i64_from_32
  15. $_i64_from_u32
  16. $_i64_not
  17. $_i64_and
  18. $_i64_or
  19. $_i64_xor
  20. $_i64_lnot
  21. $_i64_land
  22. $_i64_lor
  23. $_i64_add
  24. $_i64_sub
  25. $_i64_neg
  26. $_i64_mul
  27. $_i64_udiv_64_by_32
  28. $_i64_shl
  29. $_i64_shr
  30. $_i64_sar
  31. $_i64_eq
  32. $_i64_neq
  33. $_i64_le
  34. $_i64_ule
  35. $_i64_l
  36. $_i64_ul
  37. $_i64_ge
  38. $_i64_uge
  39. $_i64_g
  40. $_i64_ug
  41. fun int64_init 0 {
  42. $int64_runtime
  43. $fd
  44. @fd "/disk1/int64/int64.asm" vfs_open = ;
  45. @int64_runtime asmctx_init = ;
  46. #int64_runtime ASMCTX_VERBOSE take_addr 0 = ;
  47. int64_runtime ASMCTX_DEBUG take_addr 0 = ;
  48. int64_runtime fd asmctx_set_fd ;
  49. int64_runtime asmctx_compile ;
  50. fd vfs_close ;
  51. @_i64_from_32 int64_runtime "i64_from_32" asmctx_get_symbol_addr = ;
  52. @_i64_from_u32 int64_runtime "i64_from_u32" asmctx_get_symbol_addr = ;
  53. @_i64_not int64_runtime "i64_not" asmctx_get_symbol_addr = ;
  54. @_i64_and int64_runtime "i64_and" asmctx_get_symbol_addr = ;
  55. @_i64_or int64_runtime "i64_or" asmctx_get_symbol_addr = ;
  56. @_i64_xor int64_runtime "i64_xor" asmctx_get_symbol_addr = ;
  57. @_i64_lnot int64_runtime "i64_lnot" asmctx_get_symbol_addr = ;
  58. @_i64_land int64_runtime "i64_land" asmctx_get_symbol_addr = ;
  59. @_i64_lor int64_runtime "i64_lor" asmctx_get_symbol_addr = ;
  60. @_i64_add int64_runtime "i64_add" asmctx_get_symbol_addr = ;
  61. @_i64_sub int64_runtime "i64_sub" asmctx_get_symbol_addr = ;
  62. @_i64_neg int64_runtime "i64_neg" asmctx_get_symbol_addr = ;
  63. @_i64_mul int64_runtime "i64_mul" asmctx_get_symbol_addr = ;
  64. @_i64_udiv_64_by_32 int64_runtime "i64_udiv_64_by_32" asmctx_get_symbol_addr = ;
  65. @_i64_shl int64_runtime "i64_shl" asmctx_get_symbol_addr = ;
  66. @_i64_shr int64_runtime "i64_shr" asmctx_get_symbol_addr = ;
  67. @_i64_sar int64_runtime "i64_sar" asmctx_get_symbol_addr = ;
  68. @_i64_eq int64_runtime "i64_eq" asmctx_get_symbol_addr = ;
  69. @_i64_neq int64_runtime "i64_neq" asmctx_get_symbol_addr = ;
  70. @_i64_le int64_runtime "i64_le" asmctx_get_symbol_addr = ;
  71. @_i64_ule int64_runtime "i64_ule" asmctx_get_symbol_addr = ;
  72. @_i64_l int64_runtime "i64_l" asmctx_get_symbol_addr = ;
  73. @_i64_ul int64_runtime "i64_ul" asmctx_get_symbol_addr = ;
  74. @_i64_ge int64_runtime "i64_ge" asmctx_get_symbol_addr = ;
  75. @_i64_uge int64_runtime "i64_uge" asmctx_get_symbol_addr = ;
  76. @_i64_g int64_runtime "i64_g" asmctx_get_symbol_addr = ;
  77. @_i64_ug int64_runtime "i64_ug" asmctx_get_symbol_addr = ;
  78. int64_runtime asmctx_destroy ;
  79. }
  80. fun int64_destroy 0 {
  81. #int64_runtime asmctx_destroy ;
  82. }
  83. fun i64_init 0 {
  84. $i
  85. @i 8 malloc = ;
  86. i 0 = ;
  87. i 4 + 0 = ;
  88. i ret ;
  89. }
  90. fun i64_destroy 1 {
  91. 0 param free ;
  92. }
  93. fun i64_to_32 1 {
  94. 0 param ** ret ;
  95. }
  96. fun i64_to_upper32 1 {
  97. 0 param 4 + ** ret ;
  98. }
  99. fun i64_to_bool 1 {
  100. 0 param ** 0 param 4 + ** || ret ;
  101. }
  102. fun i64_cast_to_u8 1 {
  103. $v
  104. @v 0 param = ;
  105. v v ** 0xff & = ;
  106. v 4 + 0 = ;
  107. }
  108. fun i64_cast_to_u16 1 {
  109. $v
  110. @v 0 param = ;
  111. v v ** 0xffff & = ;
  112. v 4 + 0 = ;
  113. }
  114. fun i64_cast_to_u32 1 {
  115. $v
  116. @v 0 param = ;
  117. v 4 + 0 = ;
  118. }
  119. fun i64_copy 2 {
  120. $to
  121. $from
  122. @to 1 param = ;
  123. @from 0 param = ;
  124. 8 from to memcpy ;
  125. }
  126. fun i64_from_32 2 {
  127. 1 param 0 param _i64_from_32 \2 ;
  128. }
  129. fun i64_from_u32 2 {
  130. 1 param 0 param _i64_from_u32 \2 ;
  131. }
  132. fun i64_not 1 {
  133. 0 param _i64_not \1 ;
  134. }
  135. fun i64_and 2 {
  136. 1 param 0 param _i64_and \2 ;
  137. }
  138. fun i64_or 2 {
  139. 1 param 0 param _i64_or \2 ;
  140. }
  141. fun i64_xor 2 {
  142. 1 param 0 param _i64_xor \2 ;
  143. }
  144. fun i64_lnot 1 {
  145. 0 param _i64_lnot \1 ;
  146. }
  147. fun i64_land 2 {
  148. 1 param 0 param _i64_land \2 ;
  149. }
  150. fun i64_lor 2 {
  151. 1 param 0 param _i64_lor \2 ;
  152. }
  153. fun i64_add 2 {
  154. 1 param 0 param _i64_add \2 ;
  155. }
  156. fun i64_sub 2 {
  157. 1 param 0 param _i64_sub \2 ;
  158. }
  159. fun i64_neg 1 {
  160. 0 param _i64_neg \1 ;
  161. }
  162. fun i64_mul 2 {
  163. 1 param 0 param _i64_mul \2 ;
  164. }
  165. fun i64_udiv_64_by_32 2 {
  166. 1 param 0 param _i64_udiv_64_by_32 \2 ret ;
  167. }
  168. fun i64_shl 2 {
  169. 1 param 0 param _i64_shl \2 ;
  170. }
  171. fun i64_shr 2 {
  172. 1 param 0 param _i64_shr \2 ;
  173. }
  174. fun i64_sar 2 {
  175. 1 param 0 param _i64_sar \2 ;
  176. }
  177. fun i64_eq 2 {
  178. 1 param 0 param _i64_eq \2 ;
  179. }
  180. fun i64_neq 2 {
  181. 1 param 0 param _i64_neq \2 ;
  182. }
  183. fun i64_le 2 {
  184. 1 param 0 param _i64_le \2 ;
  185. }
  186. fun i64_ule 2 {
  187. 1 param 0 param _i64_ule \2 ;
  188. }
  189. fun i64_l 2 {
  190. 1 param 0 param _i64_l \2 ;
  191. }
  192. fun i64_ul 2 {
  193. 1 param 0 param _i64_ul \2 ;
  194. }
  195. fun i64_ge 2 {
  196. 1 param 0 param _i64_ge \2 ;
  197. }
  198. fun i64_uge 2 {
  199. 1 param 0 param _i64_uge \2 ;
  200. }
  201. fun i64_g 2 {
  202. 1 param 0 param _i64_g \2 ;
  203. }
  204. fun i64_ug 2 {
  205. 1 param 0 param _i64_ug \2 ;
  206. }
  207. fun int64_test_comparison 0 {
  208. $numbers
  209. $i
  210. $j
  211. # First fill it with unsigned numbers, in order
  212. @numbers 8 vector_init = ;
  213. numbers 0 vector_push_back ;
  214. numbers numbers vector_size 1 - vector_at_addr 0 = ;
  215. numbers numbers vector_size 1 - vector_at_addr 4 + 0 = ;
  216. numbers 0 vector_push_back ;
  217. numbers numbers vector_size 1 - vector_at_addr 1 = ;
  218. numbers numbers vector_size 1 - vector_at_addr 4 + 0 = ;
  219. numbers 0 vector_push_back ;
  220. numbers numbers vector_size 1 - vector_at_addr 100 = ;
  221. numbers numbers vector_size 1 - vector_at_addr 4 + 0 = ;
  222. numbers 0 vector_push_back ;
  223. numbers numbers vector_size 1 - vector_at_addr 0 = ;
  224. numbers numbers vector_size 1 - vector_at_addr 4 + 1 = ;
  225. numbers 0 vector_push_back ;
  226. numbers numbers vector_size 1 - vector_at_addr 1 = ;
  227. numbers numbers vector_size 1 - vector_at_addr 4 + 1 = ;
  228. numbers 0 vector_push_back ;
  229. numbers numbers vector_size 1 - vector_at_addr 100 = ;
  230. numbers numbers vector_size 1 - vector_at_addr 4 + 1 = ;
  231. numbers 0 vector_push_back ;
  232. numbers numbers vector_size 1 - vector_at_addr 0 = ;
  233. numbers numbers vector_size 1 - vector_at_addr 4 + 100 = ;
  234. numbers 0 vector_push_back ;
  235. numbers numbers vector_size 1 - vector_at_addr 1 = ;
  236. numbers numbers vector_size 1 - vector_at_addr 4 + 100 = ;
  237. numbers 0 vector_push_back ;
  238. numbers numbers vector_size 1 - vector_at_addr 100 = ;
  239. numbers numbers vector_size 1 - vector_at_addr 4 + 100 = ;
  240. numbers 0 vector_push_back ;
  241. numbers numbers vector_size 1 - vector_at_addr 0 = ;
  242. numbers numbers vector_size 1 - vector_at_addr 4 + 0xf0000000 = ;
  243. numbers 0 vector_push_back ;
  244. numbers numbers vector_size 1 - vector_at_addr 1 = ;
  245. numbers numbers vector_size 1 - vector_at_addr 4 + 0xf0000000 = ;
  246. numbers 0 vector_push_back ;
  247. numbers numbers vector_size 1 - vector_at_addr 100 = ;
  248. numbers numbers vector_size 1 - vector_at_addr 4 + 0xf0000000 = ;
  249. # Then do all possible pairwise comparisons
  250. @i 0 = ;
  251. while i numbers vector_size < {
  252. @j 0 = ;
  253. $y_
  254. $y
  255. @y numbers i vector_at_addr i64_copy ;
  256. while j numbers vector_size < {
  257. $x_
  258. $x
  259. @x numbers j vector_at_addr i64_copy ;
  260. @x @y i64_eq ;
  261. x_ 0 == "int64_test_comparison: error 1" assert_msg ;
  262. x j i == == "int64_test_comparison: error 2" assert_msg ;
  263. @x numbers j vector_at_addr i64_copy ;
  264. @x @y i64_neq ;
  265. x_ 0 == "int64_test_comparison: error 3" assert_msg ;
  266. x j i != == "int64_test_comparison: error 4" assert_msg ;
  267. @x numbers j vector_at_addr i64_copy ;
  268. @x @y i64_ul ;
  269. x_ 0 == "int64_test_comparison: error 5" assert_msg ;
  270. x j i < == "int64_test_comparison: error 6" assert_msg ;
  271. @x numbers j vector_at_addr i64_copy ;
  272. @x @y i64_ule ;
  273. x_ 0 == "int64_test_comparison: error 7" assert_msg ;
  274. x j i <= == "int64_test_comparison: error 8" assert_msg ;
  275. @x numbers j vector_at_addr i64_copy ;
  276. @x @y i64_ug ;
  277. x_ 0 == "int64_test_comparison: error 9" assert_msg ;
  278. x j i > == "int64_test_comparison: error 10" assert_msg ;
  279. @x numbers j vector_at_addr i64_copy ;
  280. @x @y i64_uge ;
  281. x_ 0 == "int64_test_comparison: error 11" assert_msg ;
  282. x j i >= == "int64_test_comparison: error 12" assert_msg ;
  283. @j j 1 + = ;
  284. }
  285. @i i 1 + = ;
  286. }
  287. numbers vector_destroy ;
  288. # Then again with signed numbers
  289. @numbers 8 vector_init = ;
  290. numbers 0 vector_push_back ;
  291. numbers numbers vector_size 1 - vector_at_addr 0 = ;
  292. numbers numbers vector_size 1 - vector_at_addr 4 + 0xf0000000 = ;
  293. numbers 0 vector_push_back ;
  294. numbers numbers vector_size 1 - vector_at_addr 1 = ;
  295. numbers numbers vector_size 1 - vector_at_addr 4 + 0xf0000000 = ;
  296. numbers 0 vector_push_back ;
  297. numbers numbers vector_size 1 - vector_at_addr 100 = ;
  298. numbers numbers vector_size 1 - vector_at_addr 4 + 0xf0000000 = ;
  299. numbers 0 vector_push_back ;
  300. numbers numbers vector_size 1 - vector_at_addr 0 = ;
  301. numbers numbers vector_size 1 - vector_at_addr 4 + 0 = ;
  302. numbers 0 vector_push_back ;
  303. numbers numbers vector_size 1 - vector_at_addr 1 = ;
  304. numbers numbers vector_size 1 - vector_at_addr 4 + 0 = ;
  305. numbers 0 vector_push_back ;
  306. numbers numbers vector_size 1 - vector_at_addr 100 = ;
  307. numbers numbers vector_size 1 - vector_at_addr 4 + 0 = ;
  308. numbers 0 vector_push_back ;
  309. numbers numbers vector_size 1 - vector_at_addr 0 = ;
  310. numbers numbers vector_size 1 - vector_at_addr 4 + 1 = ;
  311. numbers 0 vector_push_back ;
  312. numbers numbers vector_size 1 - vector_at_addr 1 = ;
  313. numbers numbers vector_size 1 - vector_at_addr 4 + 1 = ;
  314. numbers 0 vector_push_back ;
  315. numbers numbers vector_size 1 - vector_at_addr 100 = ;
  316. numbers numbers vector_size 1 - vector_at_addr 4 + 1 = ;
  317. numbers 0 vector_push_back ;
  318. numbers numbers vector_size 1 - vector_at_addr 0 = ;
  319. numbers numbers vector_size 1 - vector_at_addr 4 + 100 = ;
  320. numbers 0 vector_push_back ;
  321. numbers numbers vector_size 1 - vector_at_addr 1 = ;
  322. numbers numbers vector_size 1 - vector_at_addr 4 + 100 = ;
  323. numbers 0 vector_push_back ;
  324. numbers numbers vector_size 1 - vector_at_addr 100 = ;
  325. numbers numbers vector_size 1 - vector_at_addr 4 + 100 = ;
  326. # Then do all possible pairwise comparisons
  327. @i 0 = ;
  328. while i numbers vector_size < {
  329. @j 0 = ;
  330. $y_
  331. $y
  332. @y numbers i vector_at_addr i64_copy ;
  333. while j numbers vector_size < {
  334. $x_
  335. $x
  336. @x numbers j vector_at_addr i64_copy ;
  337. @x @y i64_eq ;
  338. x_ 0 == "int64_test_comparison: error 13" assert_msg ;
  339. x j i == == "int64_test_comparison: error 14" assert_msg ;
  340. @x numbers j vector_at_addr i64_copy ;
  341. @x @y i64_neq ;
  342. x_ 0 == "int64_test_comparison: error 15" assert_msg ;
  343. x j i != == "int64_test_comparison: error 16" assert_msg ;
  344. @x numbers j vector_at_addr i64_copy ;
  345. @x @y i64_l ;
  346. x_ 0 == "int64_test_comparison: error 17" assert_msg ;
  347. x j i < == "int64_test_comparison: error 18" assert_msg ;
  348. @x numbers j vector_at_addr i64_copy ;
  349. @x @y i64_le ;
  350. x_ 0 == "int64_test_comparison: error 19" assert_msg ;
  351. x j i <= == "int64_test_comparison: error 20" assert_msg ;
  352. @x numbers j vector_at_addr i64_copy ;
  353. @x @y i64_g ;
  354. x_ 0 == "int64_test_comparison: error 21" assert_msg ;
  355. x j i > == "int64_test_comparison: error 22" assert_msg ;
  356. @x numbers j vector_at_addr i64_copy ;
  357. @x @y i64_ge ;
  358. x_ 0 == "int64_test_comparison: error 23" assert_msg ;
  359. x j i >= == "int64_test_comparison: error 24" assert_msg ;
  360. @j j 1 + = ;
  361. }
  362. @i i 1 + = ;
  363. }
  364. numbers vector_destroy ;
  365. }
  366. fun int64_test 0 {
  367. $x_
  368. $x
  369. $y_
  370. $y
  371. $z_
  372. $z
  373. @x_ 0x45e5910e = ;
  374. @x 0xf38dc508 = ;
  375. @y_ 0x6f271c9a = ;
  376. @y 0x3c5af0de = ;
  377. @z @x i64_copy ;
  378. @z @x i64_eq "int64_test: error 1" assert_msg ;
  379. @z @x i64_copy ;
  380. @z i64_not ;
  381. z x ~ == "int64_test: error 2" assert_msg ;
  382. z_ x_ ~ == "int64_test: error 3" assert_msg ;
  383. @z @x i64_copy ;
  384. @z @y i64_and ;
  385. z x y & == "int64_test: error 4" assert_msg ;
  386. z_ x_ y_ & == "int64_test: error 5" assert_msg ;
  387. @z @x i64_copy ;
  388. @z @y i64_or ;
  389. z x y | == "int64_test: error 6" assert_msg ;
  390. z_ x_ y_ | == "int64_test: error 7" assert_msg ;
  391. @z @x i64_copy ;
  392. @z @y i64_xor ;
  393. z x y ^ == "int64_test: error 6" assert_msg ;
  394. z_ x_ y_ ^ == "int64_test: error 7" assert_msg ;
  395. @x 0 = ;
  396. @x_ 0 = ;
  397. @x i64_lnot ;
  398. x 1 == "int64_test: error 8" assert_msg ;
  399. x_ 0 == "int64_test: error 9" assert_msg ;
  400. @x 0x5555 = ;
  401. @x_ 0 = ;
  402. @x i64_lnot ;
  403. x 0 == "int64_test: error 10" assert_msg ;
  404. x_ 0 == "int64_test: error 11" assert_msg ;
  405. @x 0 = ;
  406. @x_ 1 = ;
  407. @x i64_lnot ;
  408. x 0 == "int64_test: error 12" assert_msg ;
  409. x_ 0 == "int64_test: error 13" assert_msg ;
  410. @x 0 = ;
  411. @x_ 0 = ;
  412. @y 0 = ;
  413. @y_ 0 = ;
  414. @x @y i64_land ;
  415. x 0 == "int64_test: error 14" assert_msg ;
  416. x_ 0 == "int64_test: error 15" assert_msg ;
  417. @x 0 = ;
  418. @x_ 123 = ;
  419. @y 0 = ;
  420. @y_ 0 = ;
  421. @x @y i64_land ;
  422. x 0 == "int64_test: error 16" assert_msg ;
  423. x_ 0 == "int64_test: error 17" assert_msg ;
  424. @x 0 = ;
  425. @x_ 123 = ;
  426. @y 456 = ;
  427. @y_ 0 = ;
  428. @x @y i64_land ;
  429. x 1 == "int64_test: error 18" assert_msg ;
  430. x_ 0 == "int64_test: error 19" assert_msg ;
  431. @x 0 = ;
  432. @x_ 0 = ;
  433. @y 0 = ;
  434. @y_ 0 = ;
  435. @x @y i64_lor ;
  436. x 0 == "int64_test: error 20" assert_msg ;
  437. x_ 0 == "int64_test: error 21" assert_msg ;
  438. @x 0 = ;
  439. @x_ 123 = ;
  440. @y 0 = ;
  441. @y_ 0 = ;
  442. @x @y i64_lor ;
  443. x 1 == "int64_test: error 22" assert_msg ;
  444. x_ 0 == "int64_test: error 23" assert_msg ;
  445. @x 0 = ;
  446. @x_ 123 = ;
  447. @y 456 = ;
  448. @y_ 0 = ;
  449. @x @y i64_lor ;
  450. x 1 == "int64_test: error 24" assert_msg ;
  451. x_ 0 == "int64_test: error 25" assert_msg ;
  452. @x 0 = ;
  453. @x_ 123 = ;
  454. @y 456 = ;
  455. @y_ 0 = ;
  456. @x @y i64_add ;
  457. x 456 == "int64_test: error 26" assert_msg ;
  458. x_ 123 == "int64_test: error 27" assert_msg ;
  459. @x 0x80001234 = ;
  460. @x_ 0 = ;
  461. @y 0x84560000 = ;
  462. @y_ 0 = ;
  463. @x @y i64_add ;
  464. x 0x4561234 == "int64_test: error 28" assert_msg ;
  465. x_ 1 == "int64_test: error 29" assert_msg ;
  466. @x 0 = ;
  467. @x_ 1 = ;
  468. @y 0x123 = ;
  469. @y_ 0 = ;
  470. @x @y i64_sub ;
  471. x 0 0x123 - == "int64_test: error 30" assert_msg ;
  472. x_ 0 == "int64_test: error 31" assert_msg ;
  473. @x 0x12312745 = ;
  474. @x_ 0x2137 = ;
  475. @y 0x3445 = ;
  476. @y_ 0 = ;
  477. @x @y i64_mul ;
  478. x 0xe3399999 == "int64_test: error 32" assert_msg ;
  479. x_ 0x6c82389 == "int64_test: error 33" assert_msg ;
  480. @y 0x12312745 = ;
  481. @y_ 0x2137 = ;
  482. @x 0x3445 = ;
  483. @x_ 0 = ;
  484. @x @y i64_mul ;
  485. x 0xe3399999 == "int64_test: error 34" assert_msg ;
  486. x_ 0x6c82389 == "int64_test: error 35" assert_msg ;
  487. @x 0x12345678 = ;
  488. @x_ 0x12345678 = ;
  489. @y 0x8 = ;
  490. @y_ 0 = ;
  491. @x @y i64_shl ;
  492. x 0x34567800 == "int64_test: error 36" assert_msg ;
  493. x_ 0x34567812 == "int64_test: error 37" assert_msg ;
  494. @x 0x12345678 = ;
  495. @x_ 0x12345678 = ;
  496. @y 0x24 = ;
  497. @y_ 0 = ;
  498. @x @y i64_shl ;
  499. x 0 == "int64_test: error 38" assert_msg ;
  500. x_ 0x23456780 == "int64_test: error 39" assert_msg ;
  501. @x 0x12345678 = ;
  502. @x_ 0x12345678 = ;
  503. @y 0x8 = ;
  504. @y_ 0 = ;
  505. @x @y i64_shr ;
  506. x 0x78123456 == "int64_test: error 40" assert_msg ;
  507. x_ 0x00123456 == "int64_test: error 41" assert_msg ;
  508. @x 0x12345678 = ;
  509. @x_ 0x12345678 = ;
  510. @y 0x24 = ;
  511. @y_ 0 = ;
  512. @x @y i64_shr ;
  513. x 0x01234567 == "int64_test: error 42" assert_msg ;
  514. x_ 0 == "int64_test: error 43" assert_msg ;
  515. @x 0x12345678 = ;
  516. @x_ 0x92345678 = ;
  517. @y 0x8 = ;
  518. @y_ 0 = ;
  519. @x @y i64_shr ;
  520. x 0x78123456 == "int64_test: error 44" assert_msg ;
  521. x_ 0x00923456 == "int64_test: error 45" assert_msg ;
  522. @x 0x12345678 = ;
  523. @x_ 0x92345678 = ;
  524. @y 0x24 = ;
  525. @y_ 0 = ;
  526. @x @y i64_shr ;
  527. x 0x09234567 == "int64_test: error 46" assert_msg ;
  528. x_ 0 == "int64_test: error 47" assert_msg ;
  529. @x 0x12345678 = ;
  530. @x_ 0x12345678 = ;
  531. @y 0x8 = ;
  532. @y_ 0 = ;
  533. @x @y i64_sar ;
  534. x 0x78123456 == "int64_test: error 48" assert_msg ;
  535. x_ 0x00123456 == "int64_test: error 49" assert_msg ;
  536. @x 0x12345678 = ;
  537. @x_ 0x12345678 = ;
  538. @y 0x24 = ;
  539. @y_ 0 = ;
  540. @x @y i64_sar ;
  541. x 0x01234567 == "int64_test: error 50" assert_msg ;
  542. x_ 0 == "int64_test: error 51" assert_msg ;
  543. @x 0x12345678 = ;
  544. @x_ 0x92345678 = ;
  545. @y 0x8 = ;
  546. @y_ 0 = ;
  547. @x @y i64_sar ;
  548. x 0x78123456 == "int64_test: error 52" assert_msg ;
  549. x_ 0xff923456 == "int64_test: error 53" assert_msg ;
  550. @x 0x12345678 = ;
  551. @x_ 0x92345678 = ;
  552. @y 0x24 = ;
  553. @y_ 0 = ;
  554. @x @y i64_sar ;
  555. x 0xf9234567 == "int64_test: error 54" assert_msg ;
  556. x_ 0xffffffff == "int64_test: error 55" assert_msg ;
  557. @x 0x123 = ;
  558. @x_ 0 = ;
  559. @x i64_neg ;
  560. x 0 0x123 - == "int64_test: error 56" assert_msg ;
  561. x_ 0 1 - == "int64_test: error 57" assert_msg ;
  562. int64_test_comparison ;
  563. "Tests for int64 successfully passed!\n" log ;
  564. }