mov32-mem.wast 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. (module
  2. (type $t0 (func))
  3. (type $t1 (func (param i32)))
  4. (type $t2 (func (param i32 i32)))
  5. (type $t3 (func (param i32 i32 i32)))
  6. (type $t4 (func (result i32)))
  7. (type $t5 (func (param i32) (result i32)))
  8. (type $t6 (func (param i32 i32) (result i32)))
  9. (import "e" "get_seg" (func $e.get_seg (type $t5)))
  10. (import "e" "safe_write32_slow" (func $e.safe_write32_slow (type $t2)))
  11. (import "e" "safe_read32s_slow" (func $e.safe_read32s_slow (type $t5)))
  12. (import "e" "instr_F4" (func $e.instr_F4 (type $t0)))
  13. (import "e" "m" (memory $e.m 256))
  14. (func $f (export "f") (type $t1) (param $p0 i32)
  15. (local $l0 i32) (local $l1 i32) (local $l2 i32) (local $l3 i32) (local $l4 i32)
  16. (set_local $l0
  17. (get_local $p0))
  18. (set_local $l1
  19. (i32.const 10000))
  20. (loop $L0
  21. (block $B1
  22. (block $B2
  23. (br_table $B2 $B1
  24. (get_local $l0)))
  25. (i32.store
  26. (i32.const 560)
  27. (i32.load
  28. (i32.const 556)))
  29. (set_local $l2
  30. (i32.add
  31. (i32.add
  32. (i32.load
  33. (i32.const 16))
  34. (i32.const 32))
  35. (call $e.get_seg
  36. (i32.const 3))))
  37. (set_local $l3
  38. (i32.load
  39. (i32.const 4)))
  40. (if $I3
  41. (i32.and
  42. (i32.eq
  43. (i32.and
  44. (tee_local $l4
  45. (i32.load offset=4194304
  46. (i32.shl
  47. (i32.shr_u
  48. (get_local $l2)
  49. (i32.const 12))
  50. (i32.const 2))))
  51. (i32.const 4075))
  52. (i32.const 1))
  53. (i32.le_s
  54. (i32.and
  55. (get_local $l2)
  56. (i32.const 4095))
  57. (i32.const 4092)))
  58. (then
  59. (i32.store offset=8388608 align=1
  60. (tee_local $l4
  61. (i32.xor
  62. (i32.and
  63. (get_local $l4)
  64. (i32.const -4096))
  65. (get_local $l2)))
  66. (get_local $l3)))
  67. (else
  68. (call $e.safe_write32_slow
  69. (get_local $l2)
  70. (get_local $l3))))
  71. (i32.store
  72. (i32.const 560)
  73. (i32.add
  74. (i32.load
  75. (i32.const 556))
  76. (i32.const 6)))
  77. (set_local $l2
  78. (i32.add
  79. (i32.add
  80. (i32.load
  81. (i32.const 12))
  82. (i32.const 28))
  83. (call $e.get_seg
  84. (i32.const 3))))
  85. (set_local $l3
  86. (i32.load
  87. (i32.const 8)))
  88. (if $I4
  89. (i32.and
  90. (i32.eq
  91. (i32.and
  92. (tee_local $l4
  93. (i32.load offset=4194304
  94. (i32.shl
  95. (i32.shr_u
  96. (get_local $l2)
  97. (i32.const 12))
  98. (i32.const 2))))
  99. (i32.const 4075))
  100. (i32.const 1))
  101. (i32.le_s
  102. (i32.and
  103. (get_local $l2)
  104. (i32.const 4095))
  105. (i32.const 4092)))
  106. (then
  107. (i32.store offset=8388608 align=1
  108. (tee_local $l4
  109. (i32.xor
  110. (i32.and
  111. (get_local $l4)
  112. (i32.const -4096))
  113. (get_local $l2)))
  114. (get_local $l3)))
  115. (else
  116. (call $e.safe_write32_slow
  117. (get_local $l2)
  118. (get_local $l3))))
  119. (i32.store
  120. (i32.const 560)
  121. (i32.add
  122. (i32.load
  123. (i32.const 556))
  124. (i32.const 12)))
  125. (i32.store
  126. (i32.const 28)
  127. (if $I5 (result i32)
  128. (i32.and
  129. (i32.eq
  130. (i32.and
  131. (tee_local $l3
  132. (i32.load offset=4194304
  133. (i32.shl
  134. (i32.shr_u
  135. (tee_local $l2
  136. (i32.add
  137. (i32.add
  138. (i32.load
  139. (i32.const 16))
  140. (i32.const 28))
  141. (call $e.get_seg
  142. (i32.const 3))))
  143. (i32.const 12))
  144. (i32.const 2))))
  145. (i32.const 4073))
  146. (i32.const 1))
  147. (i32.le_s
  148. (i32.and
  149. (get_local $l2)
  150. (i32.const 4095))
  151. (i32.const 4092)))
  152. (then
  153. (i32.load offset=8388608 align=1
  154. (i32.xor
  155. (i32.and
  156. (get_local $l3)
  157. (i32.const -4096))
  158. (get_local $l2))))
  159. (else
  160. (call $e.safe_read32s_slow
  161. (get_local $l2)))))
  162. (i32.store
  163. (i32.const 560)
  164. (i32.add
  165. (i32.load
  166. (i32.const 556))
  167. (i32.const 18)))
  168. (i32.store
  169. (i32.const 32)
  170. (if $I6 (result i32)
  171. (i32.and
  172. (i32.eq
  173. (i32.and
  174. (tee_local $l3
  175. (i32.load offset=4194304
  176. (i32.shl
  177. (i32.shr_u
  178. (tee_local $l2
  179. (i32.add
  180. (i32.add
  181. (i32.load
  182. (i32.const 12))
  183. (i32.const 32))
  184. (call $e.get_seg
  185. (i32.const 3))))
  186. (i32.const 12))
  187. (i32.const 2))))
  188. (i32.const 4073))
  189. (i32.const 1))
  190. (i32.le_s
  191. (i32.and
  192. (get_local $l2)
  193. (i32.const 4095))
  194. (i32.const 4092)))
  195. (then
  196. (i32.load offset=8388608 align=1
  197. (i32.xor
  198. (i32.and
  199. (get_local $l3)
  200. (i32.const -4096))
  201. (get_local $l2))))
  202. (else
  203. (call $e.safe_read32s_slow
  204. (get_local $l2)))))
  205. (i32.store
  206. (i32.const 560)
  207. (i32.add
  208. (i32.load
  209. (i32.const 556))
  210. (i32.const 24)))
  211. (i32.store
  212. (i32.const 556)
  213. (i32.add
  214. (i32.load
  215. (i32.const 556))
  216. (i32.const 25)))
  217. (call $e.instr_F4)
  218. (i32.store
  219. (i32.const 664)
  220. (i32.add
  221. (i32.load
  222. (i32.const 664))
  223. (i32.const 5)))
  224. (return))
  225. (unreachable))))