cimo 0.0.2__tar.gz → 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. cimo-0.0.4/LICENSE +21 -0
  2. {cimo-0.0.2 → cimo-0.0.4}/PKG-INFO +5 -3
  3. cimo-0.0.4/README.md +8 -0
  4. {cimo-0.0.2 → cimo-0.0.4}/cimo/__init__.py +2 -2
  5. {cimo-0.0.2 → cimo-0.0.4}/cimo/assembler.py +316 -47
  6. {cimo-0.0.2 → cimo-0.0.4}/cimo/assembler_amd64.py +345 -18
  7. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/PORTING.md +31 -1
  8. cimo-0.0.4/cimo/backend/abislot.py +115 -0
  9. cimo-0.0.4/cimo/backend/amd64/emit.py +1503 -0
  10. cimo-0.0.4/cimo/backend/amd64/fmachain.py +119 -0
  11. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/amd64/isel.py +309 -16
  12. cimo-0.0.4/cimo/backend/amd64/qlower.py +206 -0
  13. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/amd64/sysv.py +62 -12
  14. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/amd64/targ.py +5 -1
  15. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/amd64/winabi.py +67 -13
  16. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/arm64/abi.py +16 -5
  17. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/arm64/emit.py +280 -11
  18. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/arm64/isel.py +74 -15
  19. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/arm64/pair.py +2 -0
  20. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/arm64/targ.py +2 -2
  21. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/cfg.py +11 -10
  22. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/cse.py +2 -2
  23. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/defs.py +101 -8
  24. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/emit.py +15 -0
  25. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/ext.py +18 -2
  26. cimo-0.0.4/cimo/backend/fmashare.py +97 -0
  27. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/fold.py +72 -0
  28. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/gcm.py +84 -29
  29. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/gvn.py +8 -0
  30. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/ifopt.py +38 -4
  31. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/inline.py +201 -24
  32. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/load.py +18 -0
  33. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/main.py +66 -1
  34. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/mem.py +40 -4
  35. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/nowrap.py +7 -1
  36. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/parse.py +64 -13
  37. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/rega.py +4 -1
  38. cimo-0.0.4/cimo/backend/remat.py +176 -0
  39. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/spill.py +13 -3
  40. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/sroa.py +6 -1
  41. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/thread.py +2 -0
  42. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/util.py +2 -0
  43. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/wasm/emit.py +25 -2
  44. {cimo-0.0.2 → cimo-0.0.4}/cimo/cli/commands.py +16 -7
  45. {cimo-0.0.2 → cimo-0.0.4}/cimo/cli/completion.py +9 -0
  46. {cimo-0.0.2 → cimo-0.0.4}/cimo/cli/parse.py +9 -8
  47. {cimo-0.0.2 → cimo-0.0.4}/cimo/cli/term.py +9 -3
  48. cimo-0.0.4/cimo/cpu.py +116 -0
  49. {cimo-0.0.2 → cimo-0.0.4}/cimo/driver.py +466 -65
  50. {cimo-0.0.2 → cimo-0.0.4}/cimo/execution.py +225 -32
  51. cimo-0.0.4/cimo/fault.py +532 -0
  52. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/PORTING.md +21 -2
  53. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/attr.py +15 -0
  54. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/cc.py +18 -6
  55. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/decl.py +114 -13
  56. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/diag.py +64 -14
  57. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/eval.py +241 -7
  58. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/expr.py +364 -18
  59. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/init.py +83 -7
  60. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/main.py +20 -1
  61. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/pp.py +79 -0
  62. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/qbe.py +1281 -38
  63. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/scan.py +7 -0
  64. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/scope.py +6 -1
  65. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/stmt.py +208 -8
  66. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/type.py +115 -2
  67. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/util.py +18 -0
  68. cimo-0.0.4/cimo/include/complex.h +64 -0
  69. cimo-0.0.4/cimo/include/fenv.h +50 -0
  70. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/float.h +49 -0
  71. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/math.h +1 -0
  72. cimo-0.0.4/cimo/include/setjmp.h +15 -0
  73. cimo-0.0.4/cimo/introspect.py +36 -0
  74. {cimo-0.0.2 → cimo-0.0.4}/cimo/linker.py +50 -11
  75. {cimo-0.0.2 → cimo-0.0.4}/cimo/loader.py +16 -2
  76. cimo-0.0.4/cimo/middle/earlyexit.py +317 -0
  77. {cimo-0.0.2 → cimo-0.0.4}/cimo/middle/ifconv.py +38 -4
  78. {cimo-0.0.2 → cimo-0.0.4}/cimo/middle/inner.py +291 -46
  79. {cimo-0.0.2 → cimo-0.0.4}/cimo/middle/ir.py +11 -3
  80. {cimo-0.0.2 → cimo-0.0.4}/cimo/middle/jam.py +45 -46
  81. cimo-0.0.4/cimo/middle/outer.py +373 -0
  82. cimo-0.0.4/cimo/middle/pipeline.py +174 -0
  83. cimo-0.0.4/cimo/middle/stride.py +92 -0
  84. cimo-0.0.4/cimo/middle/tile.py +273 -0
  85. cimo-0.0.4/cimo/middle/unswitch.py +303 -0
  86. cimo-0.0.4/cimo/middle/vectorize.py +1787 -0
  87. {cimo-0.0.2 → cimo-0.0.4}/cimo/preprocessor.py +16 -3
  88. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/COPYRIGHT +2 -0
  89. cimo-0.0.4/cimo/runtime/builtins.c +447 -0
  90. cimo-0.0.4/cimo/runtime/complex/__cexp.c +87 -0
  91. cimo-0.0.4/cimo/runtime/complex/__cexpf.c +68 -0
  92. cimo-0.0.4/cimo/runtime/complex/__cimo_carith.c +129 -0
  93. cimo-0.0.4/cimo/runtime/complex/cabs.c +6 -0
  94. cimo-0.0.4/cimo/runtime/complex/cabsf.c +6 -0
  95. cimo-0.0.4/cimo/runtime/complex/cacos.c +11 -0
  96. cimo-0.0.4/cimo/runtime/complex/cacosf.c +11 -0
  97. cimo-0.0.4/cimo/runtime/complex/cacosh.c +12 -0
  98. cimo-0.0.4/cimo/runtime/complex/cacoshf.c +10 -0
  99. cimo-0.0.4/cimo/runtime/complex/carg.c +6 -0
  100. cimo-0.0.4/cimo/runtime/complex/cargf.c +6 -0
  101. cimo-0.0.4/cimo/runtime/complex/casin.c +17 -0
  102. cimo-0.0.4/cimo/runtime/complex/casinf.c +15 -0
  103. cimo-0.0.4/cimo/runtime/complex/casinh.c +9 -0
  104. cimo-0.0.4/cimo/runtime/complex/casinhf.c +7 -0
  105. cimo-0.0.4/cimo/runtime/complex/catan.c +107 -0
  106. cimo-0.0.4/cimo/runtime/complex/catanf.c +105 -0
  107. cimo-0.0.4/cimo/runtime/complex/catanh.c +9 -0
  108. cimo-0.0.4/cimo/runtime/complex/catanhf.c +7 -0
  109. cimo-0.0.4/cimo/runtime/complex/ccos.c +8 -0
  110. cimo-0.0.4/cimo/runtime/complex/ccosf.c +6 -0
  111. cimo-0.0.4/cimo/runtime/complex/ccosh.c +140 -0
  112. cimo-0.0.4/cimo/runtime/complex/ccoshf.c +90 -0
  113. cimo-0.0.4/cimo/runtime/complex/cexp.c +83 -0
  114. cimo-0.0.4/cimo/runtime/complex/cexpf.c +83 -0
  115. cimo-0.0.4/cimo/runtime/complex/cimag.c +6 -0
  116. cimo-0.0.4/cimo/runtime/complex/cimagf.c +6 -0
  117. cimo-0.0.4/cimo/runtime/complex/clog.c +14 -0
  118. cimo-0.0.4/cimo/runtime/complex/clogf.c +12 -0
  119. cimo-0.0.4/cimo/runtime/complex/conj.c +6 -0
  120. cimo-0.0.4/cimo/runtime/complex/conjf.c +6 -0
  121. cimo-0.0.4/cimo/runtime/complex/cpow.c +8 -0
  122. cimo-0.0.4/cimo/runtime/complex/cpowf.c +6 -0
  123. cimo-0.0.4/cimo/runtime/complex/cproj.c +8 -0
  124. cimo-0.0.4/cimo/runtime/complex/cprojf.c +8 -0
  125. cimo-0.0.4/cimo/runtime/complex/creal.c +6 -0
  126. cimo-0.0.4/cimo/runtime/complex/crealf.c +6 -0
  127. cimo-0.0.4/cimo/runtime/complex/csin.c +9 -0
  128. cimo-0.0.4/cimo/runtime/complex/csinf.c +7 -0
  129. cimo-0.0.4/cimo/runtime/complex/csinh.c +141 -0
  130. cimo-0.0.4/cimo/runtime/complex/csinhf.c +90 -0
  131. cimo-0.0.4/cimo/runtime/complex/csqrt.c +100 -0
  132. cimo-0.0.4/cimo/runtime/complex/csqrtf.c +82 -0
  133. cimo-0.0.4/cimo/runtime/complex/ctan.c +9 -0
  134. cimo-0.0.4/cimo/runtime/complex/ctanf.c +7 -0
  135. cimo-0.0.4/cimo/runtime/complex/ctanh.c +129 -0
  136. cimo-0.0.4/cimo/runtime/complex/ctanhf.c +66 -0
  137. cimo-0.0.4/cimo/runtime/fenv.c +102 -0
  138. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/heap.c +70 -7
  139. cimo-0.0.4/cimo/runtime/internal/complex_impl.h +16 -0
  140. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/softfma.h +55 -23
  141. cimo-0.0.4/cimo/runtime/math/hypot.c +61 -0
  142. cimo-0.0.4/cimo/runtime/pyentry.c +177 -0
  143. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/symbols.txt +50 -1
  144. {cimo-0.0.2 → cimo-0.0.4}/cimo/wasm/__init__.py +9 -4
  145. {cimo-0.0.2 → cimo-0.0.4}/cimo/wasm/link.py +3 -1
  146. {cimo-0.0.2 → cimo-0.0.4}/cimo/wasm/pyodide.py +56 -7
  147. cimo-0.0.4/cimo/wat.py +226 -0
  148. {cimo-0.0.2 → cimo-0.0.4}/cimo.egg-info/PKG-INFO +5 -3
  149. {cimo-0.0.2 → cimo-0.0.4}/cimo.egg-info/SOURCES.txt +86 -0
  150. {cimo-0.0.2 → cimo-0.0.4}/pyproject.toml +1 -1
  151. {cimo-0.0.2 → cimo-0.0.4}/tests/test_abi.py +119 -0
  152. {cimo-0.0.2 → cimo-0.0.4}/tests/test_amd64_fixes.py +38 -1
  153. {cimo-0.0.2 → cimo-0.0.4}/tests/test_assembler.py +63 -0
  154. {cimo-0.0.2 → cimo-0.0.4}/tests/test_assembler_amd64.py +24 -0
  155. {cimo-0.0.2 → cimo-0.0.4}/tests/test_cli.py +26 -2
  156. cimo-0.0.4/tests/test_compile_time.py +88 -0
  157. cimo-0.0.4/tests/test_complex.py +59 -0
  158. {cimo-0.0.2 → cimo-0.0.4}/tests/test_corpora.py +31 -13
  159. cimo-0.0.4/tests/test_cpu.py +42 -0
  160. cimo-0.0.4/tests/test_cross_module.py +57 -0
  161. {cimo-0.0.2 → cimo-0.0.4}/tests/test_cse.py +12 -1
  162. {cimo-0.0.2 → cimo-0.0.4}/tests/test_diagnostics.py +17 -20
  163. {cimo-0.0.2 → cimo-0.0.4}/tests/test_execution.py +29 -1
  164. {cimo-0.0.2 → cimo-0.0.4}/tests/test_ext_kernels.py +13 -1
  165. cimo-0.0.4/tests/test_fastcall.py +144 -0
  166. cimo-0.0.4/tests/test_faults.py +434 -0
  167. cimo-0.0.4/tests/test_fenv.py +256 -0
  168. {cimo-0.0.2 → cimo-0.0.4}/tests/test_fma.py +72 -9
  169. cimo-0.0.4/tests/test_gcm_order.py +37 -0
  170. cimo-0.0.4/tests/test_gnu_extensions.py +33 -0
  171. cimo-0.0.4/tests/test_half.py +54 -0
  172. cimo-0.0.4/tests/test_half_hw.py +78 -0
  173. cimo-0.0.4/tests/test_hostlibm.py +96 -0
  174. cimo-0.0.4/tests/test_inline.py +288 -0
  175. cimo-0.0.4/tests/test_int128.py +122 -0
  176. cimo-0.0.4/tests/test_introspect.py +55 -0
  177. {cimo-0.0.2 → cimo-0.0.4}/tests/test_isel.py +29 -3
  178. {cimo-0.0.2 → cimo-0.0.4}/tests/test_middle.py +1 -1
  179. {cimo-0.0.2 → cimo-0.0.4}/tests/test_middle_random.py +32 -2
  180. {cimo-0.0.2 → cimo-0.0.4}/tests/test_preprocessor.py +3 -2
  181. {cimo-0.0.2 → cimo-0.0.4}/tests/test_regressions.py +290 -0
  182. {cimo-0.0.2 → cimo-0.0.4}/tests/test_runtime.py +95 -8
  183. cimo-0.0.4/tests/test_setjmp.py +89 -0
  184. {cimo-0.0.2 → cimo-0.0.4}/tests/test_simplify.py +36 -2
  185. cimo-0.0.4/tests/test_site.py +56 -0
  186. cimo-0.0.4/tests/test_thread_loops.py +35 -0
  187. cimo-0.0.4/tests/test_threads.py +175 -0
  188. {cimo-0.0.2 → cimo-0.0.4}/tests/test_vector.py +148 -37
  189. cimo-0.0.4/tests/test_vector_q.py +360 -0
  190. cimo-0.0.4/tests/test_vectorize.py +1233 -0
  191. cimo-0.0.4/tests/test_vectors.py +30 -0
  192. {cimo-0.0.2 → cimo-0.0.4}/tests/test_wasm.py +96 -7
  193. cimo-0.0.2/README.md +0 -8
  194. cimo-0.0.2/cimo/backend/amd64/emit.py +0 -800
  195. cimo-0.0.2/cimo/middle/pipeline.py +0 -82
  196. cimo-0.0.2/cimo/middle/unswitch.py +0 -148
  197. cimo-0.0.2/cimo/middle/vectorize.py +0 -240
  198. cimo-0.0.2/cimo/runtime/builtins.c +0 -173
  199. cimo-0.0.2/cimo/runtime/math/hypot.c +0 -67
  200. cimo-0.0.2/tests/test_inline.py +0 -140
  201. cimo-0.0.2/tests/test_site.py +0 -16
  202. cimo-0.0.2/tests/test_vectorize.py +0 -207
  203. {cimo-0.0.2 → cimo-0.0.4}/cimo/__main__.py +0 -0
  204. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/LICENSE +0 -0
  205. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/__init__.py +0 -0
  206. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/__main__.py +0 -0
  207. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/abi.py +0 -0
  208. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/alias.py +0 -0
  209. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/amd64/__init__.py +0 -0
  210. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/amd64/regs.py +0 -0
  211. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/arm64/__init__.py +0 -0
  212. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/arm64/regs.py +0 -0
  213. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/copy.py +0 -0
  214. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/live.py +0 -0
  215. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/memopt.py +0 -0
  216. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/scalar.py +0 -0
  217. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/simpl.py +0 -0
  218. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/simplify.py +0 -0
  219. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/ssa.py +0 -0
  220. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/wasm/__init__.py +0 -0
  221. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/wasm/obj.py +0 -0
  222. {cimo-0.0.2 → cimo-0.0.4}/cimo/backend/wasm/targ.py +0 -0
  223. {cimo-0.0.2 → cimo-0.0.4}/cimo/cli/__init__.py +0 -0
  224. {cimo-0.0.2 → cimo-0.0.4}/cimo/cli/report.py +0 -0
  225. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/LICENSE +0 -0
  226. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/__init__.py +0 -0
  227. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/__main__.py +0 -0
  228. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/map.py +0 -0
  229. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/prune.py +0 -0
  230. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/targ.py +0 -0
  231. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/token.py +0 -0
  232. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/tree.py +0 -0
  233. {cimo-0.0.2 → cimo-0.0.4}/cimo/frontend/utf.py +0 -0
  234. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/assert.h +0 -0
  235. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/ctype.h +0 -0
  236. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/inttypes.h +0 -0
  237. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/iso646.h +0 -0
  238. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/limits.h +0 -0
  239. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/stdalign.h +0 -0
  240. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/stdarg.h +0 -0
  241. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/stdbool.h +0 -0
  242. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/stddef.h +0 -0
  243. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/stdint.h +0 -0
  244. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/stdio.h +0 -0
  245. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/stdlib.h +0 -0
  246. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/stdnoreturn.h +0 -0
  247. {cimo-0.0.2 → cimo-0.0.4}/cimo/include/string.h +0 -0
  248. {cimo-0.0.2 → cimo-0.0.4}/cimo/middle/__init__.py +0 -0
  249. {cimo-0.0.2 → cimo-0.0.4}/cimo/middle/affine.py +0 -0
  250. {cimo-0.0.2 → cimo-0.0.4}/cimo/middle/loops.py +0 -0
  251. {cimo-0.0.2 → cimo-0.0.4}/cimo/middle/memdep.py +0 -0
  252. {cimo-0.0.2 → cimo-0.0.4}/cimo/onefile.py +0 -0
  253. {cimo-0.0.2 → cimo-0.0.4}/cimo/py.typed +0 -0
  254. {cimo-0.0.2 → cimo-0.0.4}/cimo/resources.py +0 -0
  255. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/abort.c +0 -0
  256. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/ctype/ctype.c +0 -0
  257. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/endian.h +0 -0
  258. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/errno.h +0 -0
  259. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/exp2f_data.h +0 -0
  260. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/exp_data.h +0 -0
  261. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/fenv.h +0 -0
  262. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/floatscan.h +0 -0
  263. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/intscan.h +0 -0
  264. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/libm.h +0 -0
  265. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/log2_data.h +0 -0
  266. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/log2f_data.h +0 -0
  267. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/log_data.h +0 -0
  268. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/logf_data.h +0 -0
  269. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/musl.h +0 -0
  270. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/pow_data.h +0 -0
  271. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/powf_data.h +0 -0
  272. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/shgetc.h +0 -0
  273. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/sqrt_data.h +0 -0
  274. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/stdio_impl.h +0 -0
  275. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/internal/string.h +0 -0
  276. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__cos.c +0 -0
  277. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__cosdf.c +0 -0
  278. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__expo2.c +0 -0
  279. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__expo2f.c +0 -0
  280. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__math_divzero.c +0 -0
  281. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__math_divzerof.c +0 -0
  282. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__math_invalid.c +0 -0
  283. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__math_invalidf.c +0 -0
  284. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__math_oflow.c +0 -0
  285. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__math_oflowf.c +0 -0
  286. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__math_uflow.c +0 -0
  287. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__math_uflowf.c +0 -0
  288. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__math_xflow.c +0 -0
  289. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__math_xflowf.c +0 -0
  290. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__rem_pio2.c +0 -0
  291. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__rem_pio2_large.c +0 -0
  292. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__rem_pio2f.c +0 -0
  293. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__sin.c +0 -0
  294. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__sindf.c +0 -0
  295. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__tan.c +0 -0
  296. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/__tandf.c +0 -0
  297. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/acos.c +0 -0
  298. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/acosf.c +0 -0
  299. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/acosh.c +0 -0
  300. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/acoshf.c +0 -0
  301. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/asin.c +0 -0
  302. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/asinf.c +0 -0
  303. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/asinh.c +0 -0
  304. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/asinhf.c +0 -0
  305. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/atan.c +0 -0
  306. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/atan2.c +0 -0
  307. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/atan2f.c +0 -0
  308. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/atanf.c +0 -0
  309. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/atanh.c +0 -0
  310. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/atanhf.c +0 -0
  311. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/cbrt.c +0 -0
  312. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/cbrtf.c +0 -0
  313. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/ceil.c +0 -0
  314. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/ceilf.c +0 -0
  315. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/copysign.c +0 -0
  316. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/copysignf.c +0 -0
  317. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/cos.c +0 -0
  318. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/cosf.c +0 -0
  319. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/cosh.c +0 -0
  320. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/coshf.c +0 -0
  321. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/erf.c +0 -0
  322. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/erff.c +0 -0
  323. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/exp.c +0 -0
  324. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/exp2.c +0 -0
  325. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/exp2f.c +0 -0
  326. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/exp2f_data.c +0 -0
  327. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/exp_data.c +0 -0
  328. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/expf.c +0 -0
  329. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/expm1.c +0 -0
  330. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/expm1f.c +0 -0
  331. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/fabs.c +0 -0
  332. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/fabsf.c +0 -0
  333. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/fdim.c +0 -0
  334. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/fdimf.c +0 -0
  335. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/floor.c +0 -0
  336. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/floorf.c +0 -0
  337. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/fma.c +0 -0
  338. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/fmaf.c +0 -0
  339. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/fmax.c +0 -0
  340. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/fmaxf.c +0 -0
  341. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/fmin.c +0 -0
  342. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/fminf.c +0 -0
  343. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/fmod.c +0 -0
  344. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/fmodf.c +0 -0
  345. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/frexp.c +0 -0
  346. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/frexpf.c +0 -0
  347. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/hypotf.c +0 -0
  348. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/ilogb.c +0 -0
  349. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/ilogbf.c +0 -0
  350. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/ldexp.c +0 -0
  351. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/ldexpf.c +0 -0
  352. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/lgamma.c +0 -0
  353. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/lgamma_r.c +0 -0
  354. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/lgammaf.c +0 -0
  355. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/lgammaf_r.c +0 -0
  356. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/llrint.c +0 -0
  357. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/llrintf.c +0 -0
  358. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/llround.c +0 -0
  359. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/llroundf.c +0 -0
  360. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/log.c +0 -0
  361. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/log10.c +0 -0
  362. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/log10f.c +0 -0
  363. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/log1p.c +0 -0
  364. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/log1pf.c +0 -0
  365. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/log2.c +0 -0
  366. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/log2_data.c +0 -0
  367. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/log2f.c +0 -0
  368. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/log2f_data.c +0 -0
  369. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/log_data.c +0 -0
  370. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/logb.c +0 -0
  371. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/logbf.c +0 -0
  372. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/logf.c +0 -0
  373. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/logf_data.c +0 -0
  374. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/lrint.c +0 -0
  375. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/lrintf.c +0 -0
  376. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/lround.c +0 -0
  377. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/lroundf.c +0 -0
  378. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/modf.c +0 -0
  379. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/modff.c +0 -0
  380. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/nan.c +0 -0
  381. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/nanf.c +0 -0
  382. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/nearbyint.c +0 -0
  383. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/nearbyintf.c +0 -0
  384. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/nextafter.c +0 -0
  385. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/nextafterf.c +0 -0
  386. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/pow.c +0 -0
  387. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/pow_data.c +0 -0
  388. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/powf.c +0 -0
  389. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/powf_data.c +0 -0
  390. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/remainder.c +0 -0
  391. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/remainderf.c +0 -0
  392. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/remquo.c +0 -0
  393. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/remquof.c +0 -0
  394. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/rint.c +0 -0
  395. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/rintf.c +0 -0
  396. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/round.c +0 -0
  397. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/roundf.c +0 -0
  398. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/scalbln.c +0 -0
  399. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/scalblnf.c +0 -0
  400. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/scalbn.c +0 -0
  401. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/scalbnf.c +0 -0
  402. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/signgam.c +0 -0
  403. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/sin.c +0 -0
  404. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/sinf.c +0 -0
  405. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/sinh.c +0 -0
  406. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/sinhf.c +0 -0
  407. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/sqrt.c +0 -0
  408. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/sqrtf.c +0 -0
  409. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/tan.c +0 -0
  410. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/tanf.c +0 -0
  411. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/tanh.c +0 -0
  412. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/tanhf.c +0 -0
  413. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/tgamma.c +0 -0
  414. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/tgammaf.c +0 -0
  415. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/trunc.c +0 -0
  416. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/math/truncf.c +0 -0
  417. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdio/snprintf.c +0 -0
  418. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdio/stdout.c +0 -0
  419. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdio/vfprintf.c +0 -0
  420. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/abs.c +0 -0
  421. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/atof.c +0 -0
  422. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/atoi.c +0 -0
  423. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/atol.c +0 -0
  424. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/atoll.c +0 -0
  425. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/bsearch.c +0 -0
  426. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/div.c +0 -0
  427. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/floatscan.c +0 -0
  428. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/intscan.c +0 -0
  429. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/inttypes.c +0 -0
  430. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/labs.c +0 -0
  431. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/ldiv.c +0 -0
  432. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/llabs.c +0 -0
  433. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/lldiv.c +0 -0
  434. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/qsort.c +0 -0
  435. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/qsort_nr.c +0 -0
  436. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/rand.c +0 -0
  437. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/strtod.c +0 -0
  438. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/stdlib/strtol.c +0 -0
  439. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/memchr.c +0 -0
  440. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/memcmp.c +0 -0
  441. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/memcpy.c +0 -0
  442. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/memmove.c +0 -0
  443. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/memrchr.c +0 -0
  444. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/memset.c +0 -0
  445. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/stpcpy.c +0 -0
  446. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/stpncpy.c +0 -0
  447. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strcat.c +0 -0
  448. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strchr.c +0 -0
  449. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strchrnul.c +0 -0
  450. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strcmp.c +0 -0
  451. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strcoll.c +0 -0
  452. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strcpy.c +0 -0
  453. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strcspn.c +0 -0
  454. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strdup.c +0 -0
  455. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strerror.c +0 -0
  456. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strlen.c +0 -0
  457. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strncat.c +0 -0
  458. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strncmp.c +0 -0
  459. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strncpy.c +0 -0
  460. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strndup.c +0 -0
  461. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strnlen.c +0 -0
  462. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strpbrk.c +0 -0
  463. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strrchr.c +0 -0
  464. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strspn.c +0 -0
  465. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strstr.c +0 -0
  466. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strtok.c +0 -0
  467. {cimo-0.0.2 → cimo-0.0.4}/cimo/runtime/string/strxfrm.c +0 -0
  468. {cimo-0.0.2 → cimo-0.0.4}/cimo/wasm/runtime/fma.c +0 -0
  469. {cimo-0.0.2 → cimo-0.0.4}/cimo.egg-info/dependency_links.txt +0 -0
  470. {cimo-0.0.2 → cimo-0.0.4}/cimo.egg-info/entry_points.txt +0 -0
  471. {cimo-0.0.2 → cimo-0.0.4}/cimo.egg-info/requires.txt +0 -0
  472. {cimo-0.0.2 → cimo-0.0.4}/cimo.egg-info/top_level.txt +0 -0
  473. {cimo-0.0.2 → cimo-0.0.4}/setup.cfg +0 -0
  474. {cimo-0.0.2 → cimo-0.0.4}/tests/test_backend_edges.py +0 -0
  475. {cimo-0.0.2 → cimo-0.0.4}/tests/test_backend_fold.py +0 -0
  476. {cimo-0.0.2 → cimo-0.0.4}/tests/test_bench_gate.py +0 -0
  477. {cimo-0.0.2 → cimo-0.0.4}/tests/test_constraints.py +0 -0
  478. {cimo-0.0.2 → cimo-0.0.4}/tests/test_frontend.py +0 -0
  479. {cimo-0.0.2 → cimo-0.0.4}/tests/test_ldp_layout.py +0 -0
  480. {cimo-0.0.2 → cimo-0.0.4}/tests/test_loader.py +0 -0
  481. {cimo-0.0.2 → cimo-0.0.4}/tests/test_loader_amd64.py +0 -0
  482. {cimo-0.0.2 → cimo-0.0.4}/tests/test_m2.py +0 -0
  483. {cimo-0.0.2 → cimo-0.0.4}/tests/test_macos.py +0 -0
  484. {cimo-0.0.2 → cimo-0.0.4}/tests/test_nowrap.py +0 -0
  485. {cimo-0.0.2 → cimo-0.0.4}/tests/test_onefile.py +0 -0
  486. {cimo-0.0.2 → cimo-0.0.4}/tests/test_passes_matter.py +0 -0
  487. {cimo-0.0.2 → cimo-0.0.4}/tests/test_semantics.py +0 -0
  488. {cimo-0.0.2 → cimo-0.0.4}/tests/test_typing.py +0 -0
  489. {cimo-0.0.2 → cimo-0.0.4}/tests/test_windows.py +0 -0
cimo-0.0.4/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fariz Rahman
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cimo
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: A C compiler written in pure Python: C kernels in, machine code out.
5
5
  Author: Fariz Rahman
6
6
  License: MIT
@@ -11,17 +11,19 @@ Classifier: Topic :: Software Development :: Compilers
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Requires-Python: >=3.9
13
13
  Description-Content-Type: text/markdown
14
+ License-File: LICENSE
14
15
  Provides-Extra: dev
15
16
  Requires-Dist: pytest; extra == "dev"
16
17
  Requires-Dist: black; extra == "dev"
17
18
  Requires-Dist: isort; extra == "dev"
18
19
  Requires-Dist: numpy; extra == "dev"
19
20
  Requires-Dist: mypy; extra == "dev"
21
+ Dynamic: license-file
20
22
 
21
23
  # cimo
22
24
 
23
- A C compiler written in pure Python: compile freestanding C kernels at runtime and call them on
24
- your numpy arrays, with no compiler, SDK or native dependency on the machine.
25
+ A C compiler written in pure Python: compile C kernels at runtime and call them on your numpy
26
+ arrays, with no compiler, SDK or native dependency on the machine.
25
27
 
26
28
  See the [project README](https://github.com/farizrahman4u/cimo#readme).
27
29
 
cimo-0.0.4/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # cimo
2
+
3
+ A C compiler written in pure Python: compile C kernels at runtime and call them on your numpy
4
+ arrays, with no compiler, SDK or native dependency on the machine.
5
+
6
+ See the [project README](https://github.com/farizrahman4u/cimo#readme).
7
+
8
+ Development install, from this directory: `pip install -e '.[dev]'`
@@ -1,5 +1,5 @@
1
1
  """cimo: a C compiler written in pure Python."""
2
2
 
3
- from .driver import compile, load, Module, CompileError, KernelError
3
+ from .driver import compile, load, Module, CompileError, KernelError, add_cache_entry
4
4
 
5
- __version__ = "0.0.2"
5
+ __version__ = "0.0.4"
@@ -236,9 +236,9 @@ def _split(s):
236
236
  q = False
237
237
  elif c == '"':
238
238
  q = True
239
- elif c == '[':
239
+ elif c in '[{':
240
240
  depth += 1
241
- elif c == ']':
241
+ elif c in ']}':
242
242
  depth -= 1
243
243
  elif c == ',' and depth == 0:
244
244
  out.append(s[start:i].strip())
@@ -329,6 +329,8 @@ def _bitmask(imm, width):
329
329
 
330
330
  def _logimm(value, width):
331
331
  """GNU as: the bits above a 32-bit operation's width must be all zeros or all ones."""
332
+ if not -(1 << 64) < value < 1 << 64:
333
+ return None
332
334
  value &= M64
333
335
  if width == 32:
334
336
  hi = value >> 32
@@ -339,6 +341,8 @@ def _logimm(value, width):
339
341
 
340
342
  def _wide(value, is32):
341
343
  """(imm16, shift) if value fits a single movz, else None (GNU aarch64_wide_constant_p)."""
344
+ if not -(1 << 64) < value < 1 << 64:
345
+ return None
342
346
  value &= M64
343
347
  if is32:
344
348
  if value >> 32 not in (0, 0xffffffff):
@@ -380,6 +384,12 @@ def _shiftop(rest):
380
384
  _ADDSUB = {'add': (0, 0), 'adds': (0, 1), 'sub': (1, 0), 'subs': (1, 1)}
381
385
 
382
386
 
387
+ def _notzr(r):
388
+ """r isn't xzr/wzr: for a field in which 31 means sp, where zr would silently become sp."""
389
+ if not r[2] and r[1] == 31:
390
+ raise AssemblerError('the zero register is not allowed here (31 would be sp)')
391
+
392
+
383
393
  def _addsub(a, op, s, rd, rn, ops3, ops_rest):
384
394
  """ops3: the third operand string; ops_rest: [optional shift operand]."""
385
395
  if _isreg(ops3):
@@ -394,13 +404,19 @@ def _addsub(a, op, s, rd, rn, ops3, ops_rest):
394
404
  raise AssemblerError('shift amount out of range')
395
405
  return (0x0b000000 | _sf(rd) | op << 30 | s << 29 | _SHIFTOP[how] << 22
396
406
  | rm[1] << 16 | n << 10 | rn[1] << 5 | rd[1])
397
- if how not in _EXTOP or rm[0] != 'w' or rd[0] != 'x' or not 0 <= n <= 4:
407
+ if how not in _EXTOP or rm[0] != 'w' or rd[0] != 'x' or rn[0] != 'x' or not 0 <= n <= 4:
398
408
  raise AssemblerError('bad extended register %r' % ops_rest[0])
409
+ _notzr(rn) # field 31 is sp here, in Rn always and in Rd unless the flags are set
410
+ if not s:
411
+ _notzr(rd)
399
412
  return (0x0b200000 | _sf(rd) | op << 30 | s << 29 | rm[1] << 16 | _EXTOP[how] << 13
400
413
  | n << 10 | rn[1] << 5 | rd[1])
401
414
  if rd[2] or rn[2]:
402
415
  # extended register form (needed when sp is involved): UXTX / UXTW
403
416
  _same(rd, rn)
417
+ _notzr(rn)
418
+ if not s:
419
+ _notzr(rd)
404
420
  opt = 3 if rd[0] == 'x' else 2
405
421
  if rm[0] != rd[0]:
406
422
  raise AssemblerError('operand size mismatch')
@@ -492,7 +508,7 @@ def _i_logic(a, mn, ops):
492
508
  | rd[1])
493
509
  if imm_op is None or len(ops) != 3:
494
510
  raise AssemblerError('%s takes registers' % mn)
495
- rd = _reg(ops[0], sp=mn != 'ands')
511
+ rd = _reg(ops[0], sp=mn != 'ands', zr=mn == 'ands')
496
512
  _same(rd, rn)
497
513
  width = 64 if rd[0] == 'x' else 32
498
514
  enc = _logimm(_imm(ops[2], True), width)
@@ -643,20 +659,24 @@ def _i_mov(a, mn, ops):
643
659
  rd, rm = _reg(ops[0], sp=True), _reg(ops[1], sp=True)
644
660
  _same(rd, rm)
645
661
  if rd[2] or rm[2]:
662
+ _notzr(rd), _notzr(rm)
646
663
  return 0x11000000 | _sf(rd) | rm[1] << 5 | rd[1] # add Rd, Rn, #0
647
664
  return 0x2a0003e0 | _sf(rd) | rm[1] << 16 | rd[1] # orr Rd, zr, Rm
648
665
  rd = _reg(ops[0], sp=True)
649
666
  if not _isimm(ops[1]):
650
667
  raise AssemblerError('unsupported mov operand %r' % ops[1])
651
668
  v = _imm(ops[1])
669
+ if not -(1 << 64) < v < 1 << 64:
670
+ raise AssemblerError('immediate %s does not fit 64 bits' % ops[1]) # GNU as: (-2^64, 2^64), wrapped
652
671
  is32 = rd[0] == 'w'
653
672
  if not rd[2]:
654
673
  w = _wide(v, is32)
655
674
  if w is not None:
656
675
  return 0x52800000 | _sf(rd) | (w[1] // 16) << 21 | w[0] << 5 | rd[1]
657
- w = _wide(~v & (0xffffffff if is32 else M64), is32)
676
+ w = _wide(~v & M64, is32) # the whole value, so _wide sees bits above a w register's 32
658
677
  if w is not None:
659
678
  return 0x12800000 | _sf(rd) | (w[1] // 16) << 21 | w[0] << 5 | rd[1]
679
+ _notzr(rd) # the orr below writes sp for register 31
660
680
  enc = _logimm(v, 32 if is32 else 64)
661
681
  if enc is None:
662
682
  raise AssemblerError('immediate %s cannot be moved by a single instruction' % ops[1])
@@ -761,6 +781,128 @@ def _i_simd(a, mn, ops): # cnt Vd.8B, Vn.8B / addv Bd, Vn.8B (the popcount buil
761
781
  return (0x0e205800 if mn == 'cnt' else 0x0e31b800) | int(n.group(1)) << 5 | int(d.group(1))
762
782
 
763
783
 
784
+ _VREG8H = re.compile(r'^v([0-9]|[12][0-9]|3[01])\.8h$')
785
+ _LIST3 = re.compile(r'^\{\s*v([0-9]|[12][0-9]|3[01])\.(8b|16b)\s*,\s*v([0-9]|[12][0-9]|3[01])\.\2\s*,'
786
+ r'\s*v([0-9]|[12][0-9]|3[01])\.\2\s*\}$')
787
+ _VREG16B = re.compile(r'^v([0-9]|[12][0-9]|3[01])\.16b$')
788
+
789
+
790
+ def _i_bytes(a, mn, ops):
791
+ """cimo (vectorize's loops over bytes): ushll Vd.8H, Vn.8B, #0 (uxtl); xtn Vd.8B, Vn.8H; ld3 {Vt.8B, Vt+1.8B, Vt+2.8B},
792
+ [Xn], consecutive registers modulo 32."""
793
+ if mn == 'ld3':
794
+ if len(ops) != 2:
795
+ raise AssemblerError('ld3 needs 2 operands')
796
+ m = _LIST3.match(ops[0].strip().lower())
797
+ t = [int(m.group(1)), int(m.group(3)), int(m.group(4))] if m else None
798
+ if t is None or t[1] != (t[0] + 1) % 32 or t[2] != (t[0] + 2) % 32:
799
+ raise AssemblerError('ld3 takes three consecutive .8b registers: %r' % ops[0])
800
+ b = ops[1].strip().lower()
801
+ if not (b.startswith('[') and b.endswith(']')):
802
+ raise AssemblerError('ld3 takes [Xn]')
803
+ n = _reg(b[1:-1].strip(), 'x', sp=True, zr=False)[1]
804
+ return (0x4c404000 if m.group(2) == '16b' else 0x0c404000) | n << 5 | t[0]
805
+ if mn in ('umull', 'umlal', 'umull2', 'umlal2'): # Vd.8H, Vn.8B, Vm.8B (the 2 forms: .16B, the upper halves)
806
+ if len(ops) != 3:
807
+ raise AssemblerError('%s needs 3 operands' % mn)
808
+ src = _VREG16B if mn.endswith('2') else _VREG8B
809
+ d = _VREG8H.match(ops[0].strip().lower())
810
+ n, m = src.match(ops[1].strip().lower()), src.match(ops[2].strip().lower())
811
+ if not d or not n or not m:
812
+ raise AssemblerError('unsupported operands for %s' % mn)
813
+ return ((0x2e20c000 if mn.startswith('umull') else 0x2e208000) | (0x40000000 if mn.endswith('2') else 0)
814
+ | int(m.group(1)) << 16 | int(n.group(1)) << 5 | int(d.group(1)))
815
+ if mn == 'ushll2':
816
+ if len(ops) != 3 or _imm(ops[2], True) != 0:
817
+ raise AssemblerError('ushll2 takes Vd.8h, Vn.16b, #0')
818
+ d, n = _VREG8H.match(ops[0].strip().lower()), _VREG16B.match(ops[1].strip().lower())
819
+ if not d or not n:
820
+ raise AssemblerError('unsupported operands for ushll2')
821
+ return 0x6f08a400 | int(n.group(1)) << 5 | int(d.group(1))
822
+ if mn == 'ushll':
823
+ if len(ops) != 3 or _imm(ops[2], True) != 0:
824
+ raise AssemblerError('ushll takes Vd.8h, Vn.8b, #0')
825
+ d, n = _VREG8H.match(ops[0].strip().lower()), _VREG8B.match(ops[1].strip().lower())
826
+ if not d or not n:
827
+ raise AssemblerError('unsupported operands for ushll')
828
+ return 0x2f08a400 | int(n.group(1)) << 5 | int(d.group(1))
829
+ if mn == 'shrn': # Vd.8B, Vn.8H, #s
830
+ if len(ops) != 3:
831
+ raise AssemblerError('shrn needs 3 operands')
832
+ d, n = _VREG8B.match(ops[0].strip().lower()), _VREG8H.match(ops[1].strip().lower())
833
+ s = _imm(ops[2], True)
834
+ if not d or not n or not 1 <= s <= 8:
835
+ raise AssemblerError('unsupported operands for shrn')
836
+ return 0x0f008400 | (16 - s) << 16 | int(n.group(1)) << 5 | int(d.group(1))
837
+ if len(ops) != 2: # xtn
838
+ raise AssemblerError('xtn needs 2 operands')
839
+ d, n = _VREG8B.match(ops[0].strip().lower()), _VREG8H.match(ops[1].strip().lower())
840
+ if not d or not n:
841
+ raise AssemblerError('unsupported operands for xtn')
842
+ return 0x0e212800 | int(n.group(1)) << 5 | int(d.group(1))
843
+
844
+
845
+ _VARR = re.compile(r'^v([0-9]|[12][0-9]|3[01])\.(8b|16b|4h|8h|2s|4s|2d)$')
846
+ # conversions between vector arrangements: (destination arrangement, source arrangement) -> base encoding (Q in it)
847
+ _VCVT = {
848
+ 'sshll': {('8h', '8b'): 0x0f08a400, ('4s', '4h'): 0x0f10a400, ('2d', '2s'): 0x0f20a400},
849
+ 'sshll2': {('8h', '16b'): 0x4f08a400, ('4s', '8h'): 0x4f10a400, ('2d', '4s'): 0x4f20a400},
850
+ 'ushll': {('8h', '8b'): 0x2f08a400, ('4s', '4h'): 0x2f10a400, ('2d', '2s'): 0x2f20a400},
851
+ 'ushll2': {('8h', '16b'): 0x6f08a400, ('4s', '8h'): 0x6f10a400, ('2d', '4s'): 0x6f20a400},
852
+ 'xtn': {('8b', '8h'): 0x0e212800, ('4h', '4s'): 0x0e612800, ('2s', '2d'): 0x0ea12800},
853
+ 'xtn2': {('16b', '8h'): 0x4e212800, ('8h', '4s'): 0x4e612800, ('4s', '2d'): 0x4ea12800},
854
+ 'scvtf': {('4s', '4s'): 0x4e21d800, ('2d', '2d'): 0x4e61d800},
855
+ 'ucvtf': {('4s', '4s'): 0x6e21d800, ('2d', '2d'): 0x6e61d800},
856
+ 'fcvtzs': {('4s', '4s'): 0x4ea1b800, ('2d', '2d'): 0x4ee1b800},
857
+ 'fcvtzu': {('4s', '4s'): 0x6ea1b800, ('2d', '2d'): 0x6ee1b800},
858
+ 'fcvtl': {('2d', '2s'): 0x0e617800, ('4s', '4h'): 0x0e217800}, 'fcvtl2': {('2d', '4s'): 0x4e617800},
859
+ 'fcvtn': {('2s', '2d'): 0x0e616800, ('4h', '4s'): 0x0e216800}, 'fcvtn2': {('4s', '2d'): 0x4e616800},
860
+ }
861
+
862
+
863
+ def _i_vcvt(a, mn, ops):
864
+ """sshll/ushll(2) Vd, Vn, #0 (sxtl/uxtl), xtn(2), scvtf/ucvtf/fcvtzs/fcvtzu on vectors, fcvtl(2), fcvtn(2)."""
865
+ if mn in ('sshll', 'sshll2', 'ushll', 'ushll2'):
866
+ if len(ops) != 3 or _imm(ops[2], True) != 0:
867
+ raise AssemblerError('%s takes Vd, Vn, #0' % mn)
868
+ elif len(ops) != 2:
869
+ raise AssemblerError('%s needs 2 operands' % mn)
870
+ d, n = _VARR.match(ops[0].strip().lower()), _VARR.match(ops[1].strip().lower())
871
+ base = _VCVT[mn].get((d.group(2), n.group(2))) if d and n else None
872
+ if base is None:
873
+ raise AssemblerError('unsupported operands for %s' % mn)
874
+ return base | int(n.group(1)) << 5 | int(d.group(1))
875
+
876
+
877
+ def _i_tbl(a, mn, ops):
878
+ """tbl Vd.16b, {Vn.16b}, Vm.16b: one table register."""
879
+ if len(ops) != 3:
880
+ raise AssemblerError('tbl needs 3 operands')
881
+ t = ops[1].strip().lower()
882
+ d, m = _VREG16B.match(ops[0].strip().lower()), _VREG16B.match(ops[2].strip().lower())
883
+ n = _VREG16B.match(t[1:-1].strip()) if t.startswith('{') and t.endswith('}') else None
884
+ if not d or not n or not m:
885
+ raise AssemblerError('unsupported operands for tbl')
886
+ return 0x4e000000 | int(m.group(1)) << 16 | int(n.group(1)) << 5 | int(d.group(1))
887
+
888
+
889
+ def _i_adc(a, mn, ops):
890
+ """adc Xd, Xn, Xm (the 64-bit form: __int128's carry)."""
891
+ if len(ops) != 3:
892
+ raise AssemblerError('adc needs 3 operands')
893
+ rd, rn, rm = (_reg(o, 'x') for o in ops)
894
+ return 0x9a000000 | rm[1] << 16 | rn[1] << 5 | rd[1]
895
+
896
+
897
+ def _vector_or(scalar):
898
+ """The encoder for a mnemonic with a scalar and a vector form: vector operands go to _i_vcvt."""
899
+ def enc(a, mn, ops):
900
+ if ops and ops[0].strip().lower().startswith('v'):
901
+ return _i_vcvt(a, mn, ops)
902
+ return scalar(a, mn, ops)
903
+ return enc
904
+
905
+
764
906
  def _fpimm8(v):
765
907
  """abcdefgh such that v is (-1)^a * (16 + efgh) / 16 * 2^n, with n from bcd: 000 is 1, 011 is
766
908
  4, 100 is -3, 111 is 0; or None."""
@@ -801,10 +943,11 @@ def _i_fmov(a, mn, ops):
801
943
  def _i_fcvt(a, mn, ops):
802
944
  if len(ops) != 2:
803
945
  raise AssemblerError('fcvt needs 2 operands')
804
- rd, rn = _reg(ops[0], 'sd'), _reg(ops[1], 'sd')
946
+ rd, rn = _reg(ops[0], 'hsd'), _reg(ops[1], 'hsd')
805
947
  if rd[0] == rn[0]:
806
948
  raise AssemblerError('fcvt needs different precisions')
807
- return (0x1e22c000 if rd[0] == 'd' else 0x1e624000) | rn[1] << 5 | rd[1]
949
+ t = {'s': 0, 'd': 1, 'h': 3} # the source's type at 22, the destination's at 15
950
+ return 0x1e224000 | t[rn[0]] << 22 | t[rd[0]] << 15 | rn[1] << 5 | rd[1]
808
951
 
809
952
 
810
953
  def _i_fcvtz(a, mn, ops): # fcvtzs/fcvtzu Rd, Fn
@@ -930,12 +1073,16 @@ _NEON3 = {'add': (0x4e208400, 's'), 'sub': (0x6e208400, 's'), 'mul': (0x4e209c00
930
1073
  'fadd': (0x4e20d400, 'f'), 'fsub': (0x4ea0d400, 'f'), 'fmul': (0x6e20dc00, 'f'), 'fdiv': (0x6e20fc00, 'f'),
931
1074
  'fminnm': (0x4ea0c400, 'f'), 'fmaxnm': (0x4e20c400, 'f'), 'fmla': (0x4e20cc00, 'f'), 'fcmeq': (0x4e20e400, 'f'),
932
1075
  'fcmge': (0x6e20e400, 'f'), 'fcmgt': (0x6ea0e400, 'f'), 'and': (0x4e201c00, ''), 'orr': (0x4ea01c00, ''),
933
- 'eor': (0x6e201c00, ''), 'bsl': (0x6e601c00, '')}
1076
+ 'eor': (0x6e201c00, ''), 'bsl': (0x6e601c00, ''), 'bit': (0x6ea01c00, ''), 'bif': (0x6ee01c00, ''), 'sshl': (0x4e204400, 's'), 'ushl': (0x6e204400, 's'),
1077
+ 'zip1': (0x4e003800, 's'), 'zip2': (0x4e007800, 's'), 'uzp1': (0x4e001800, 's'), 'uzp2': (0x4e005800, 's'),
1078
+ 'trn1': (0x4e002800, 's'), 'trn2': (0x4e006800, 's')}
934
1079
  _NEON2 = {'neg': (0x6e20b800, 's'), 'fneg': (0x6ea0f800, 'f'), 'fabs': (0x4ea0f800, 'f'), 'fsqrt': (0x6ea1f800, 'f'),
935
1080
  'mvn': (0x6e205800, '')}
936
1081
  _NEONSH = {'shl': 0x4f005400, 'ushr': 0x6f000400, 'sshr': 0x4f000400}
937
1082
  _LANES = {'16b': 0, '8h': 1, '4s': 2, '2d': 3}
938
- _VREG = re.compile(r'v(\d+)\.(16b|8h|4s|2d)$')
1083
+ _NEONW = {'saddw': 0x0ea01000, 'saddw2': 0x4ea01000, 'uaddw': 0x2ea01000, 'uaddw2': 0x6ea01000} # 2d, 2d, 2s or 4s
1084
+ _VREG = re.compile(r'v(\d+)\.(16b|8h|4s|2d|2s)$')
1085
+ _VNARROW = re.compile(r'v(\d+)\.(8b|4h|2s|16b|8h|4s)$') # saddw's third operand
939
1086
  _VELEM = re.compile(r'v(\d+)\.([bhsd])\[(\d+)\]$')
940
1087
 
941
1088
 
@@ -943,59 +1090,114 @@ def _isneon(ops):
943
1090
  return bool(ops) and ops[0].strip().lower()[:1] == 'v' and _VREG.match(ops[0].strip().lower()) is not None
944
1091
 
945
1092
 
946
- def _v(s):
947
- m = _VREG.match(s.strip().lower())
948
- if m is None:
1093
+ def _v(s, lanes=None, pattern=_VREG):
1094
+ """(register, arrangement) of a vector operand; lanes: the arrangements allowed."""
1095
+ m = pattern.match(s.strip().lower())
1096
+ if m is None or int(m[1]) > 31:
949
1097
  raise AssemblerError('expected a vector register, got %r' % s)
1098
+ if lanes is not None and m[2] not in lanes:
1099
+ raise AssemblerError('arrangement .%s not allowed here: %r' % (m[2], s))
950
1100
  return int(m[1]), m[2]
951
1101
 
952
1102
 
1103
+ _NO2D = frozenset(('mul', 'smin', 'smax', 'umin', 'umax'))
1104
+
1105
+
1106
+ def _elem(s):
1107
+ """(register, element size letter, index) of Vn.T[i], the index in range for the element size."""
1108
+ e = _VELEM.match(s.strip().lower())
1109
+ if e is None or int(e[1]) > 31:
1110
+ raise AssemblerError('expected a vector element, got %r' % s)
1111
+ k, i = e[2], int(e[3])
1112
+ if i >= {'b': 16, 'h': 8, 's': 4, 'd': 2}[k]:
1113
+ raise AssemblerError('lane index out of range: %r' % s)
1114
+ return int(e[1]), k, i
1115
+
1116
+
1117
+ def _imm5(k, i):
1118
+ return {'b': 1, 'h': 2, 's': 4, 'd': 8}[k] | i << ({'b': 1, 'h': 2, 's': 3, 'd': 4}[k])
1119
+
1120
+
953
1121
  def _neon(mn, ops):
954
- """The word of a NEON instruction whose first operand is a vector register."""
955
- d, lane = _v(ops[0])
956
- size = _LANES[lane]
957
- if mn == 'mov':
958
- n, _ = _v(ops[1])
959
- return 0x4ea01c00 | n << 16 | n << 5 | d
1122
+ """The word of a NEON instruction whose first operand is a vector register. Arrangements are checked as GNU as
1123
+ does: one for all the operands, and one the instruction has (.2s only in saddw and uaddw)."""
1124
+ if mn in _NEONW: # saddw: .8h/.4s/.2d twice, then .8b/.4h/.2s; saddw2: then .16b/.8h/.4s
1125
+ d, lane = _v(ops[0], ('8h', '4s', '2d'))
1126
+ n, _ = _v(ops[1], (lane,))
1127
+ size = {'8h': 0, '4s': 1, '2d': 2}[lane]
1128
+ narrow = ('16b', '8h', '4s') if mn.endswith('2') else ('8b', '4h', '2s')
1129
+ m, _ = _v(ops[2], (narrow[size],), _VNARROW)
1130
+ return (_NEONW[mn] & ~0x00c00000) | size << 22 | m << 16 | n << 5 | d
1131
+ if mn == 'ext': # ext Vd.16b, Vn.16b, Vm.16b, #bytes
1132
+ if len(ops) != 4:
1133
+ raise AssemblerError('ext needs 4 operands')
1134
+ d, _ = _v(ops[0], ('16b',))
1135
+ n, _ = _v(ops[1], ('16b',))
1136
+ m, _ = _v(ops[2], ('16b',))
1137
+ k = _imm(ops[3], True)
1138
+ if not 0 <= k <= 15:
1139
+ raise AssemblerError('ext index out of range')
1140
+ return 0x6e000000 | m << 16 | k << 11 | n << 5 | d
960
1141
  if mn == 'dup':
1142
+ d, lane = _v(ops[0], _LANES)
1143
+ size = _LANES[lane]
961
1144
  s = ops[1].strip().lower()
962
- e = _VELEM.match(s)
963
- if e:
964
- imm5 = {'b': 1, 'h': 2, 's': 4, 'd': 8}[e[2]] | int(e[3]) << ({'b': 1, 'h': 2, 's': 3, 'd': 4}[e[2]])
965
- return 0x4e000400 | imm5 << 16 | int(e[1]) << 5 | d
966
- r = _reg(s, 'wx')
1145
+ if _VELEM.match(s):
1146
+ n, k, i = _elem(s)
1147
+ if k != 'bhsd'[size]:
1148
+ raise AssemblerError('element size does not match .%s' % lane)
1149
+ return 0x4e000400 | _imm5(k, i) << 16 | n << 5 | d
1150
+ r = _reg(s, 'x' if size == 3 else 'w')
967
1151
  return 0x4e000c00 | (1 << size) << 16 | r[1] << 5 | d
1152
+ d, lane = _v(ops[0], _LANES)
1153
+ size = _LANES[lane]
1154
+ same = (lane,)
1155
+ if mn == 'mov':
1156
+ n, _ = _v(ops[1], ('16b',) if lane == '16b' else same)
1157
+ if lane != '16b':
1158
+ raise AssemblerError('mov of vectors takes .16b')
1159
+ return 0x4ea01c00 | n << 16 | n << 5 | d
968
1160
  if mn in _NEONSH:
969
- n, _ = _v(ops[1])
1161
+ n, _ = _v(ops[1], same)
970
1162
  amount = _imm(ops[2], True)
971
1163
  bits = 8 << size
1164
+ if not (0 <= amount < bits if mn == 'shl' else 1 <= amount <= bits):
1165
+ raise AssemblerError('shift amount %d out of range for .%s' % (amount, lane))
972
1166
  immhb = bits + amount if mn == 'shl' else 2 * bits - amount
973
1167
  return _NEONSH[mn] | immhb << 16 | n << 5 | d
974
1168
  if mn in _NEON2:
975
1169
  op, kind = _NEON2[mn]
976
- n, _ = _v(ops[1])
1170
+ _lanes_ok(mn, kind, lane)
1171
+ n, _ = _v(ops[1], same)
977
1172
  w = op | n << 5 | d
978
1173
  return w | (size << 22 if kind == 's' else (lane == '2d') << 22 if kind == 'f' else 0)
979
1174
  if mn in _NEON3:
980
1175
  op, kind = _NEON3[mn]
981
- n, _ = _v(ops[1])
982
- m, _ = _v(ops[2])
1176
+ _lanes_ok(mn, kind, lane)
1177
+ n, _ = _v(ops[1], same)
1178
+ m, _ = _v(ops[2], same)
983
1179
  w = op | m << 16 | n << 5 | d
984
1180
  return w | (size << 22 if kind == 's' else (lane == '2d') << 22 if kind == 'f' else 0)
985
1181
  raise AssemblerError('unsupported vector instruction %r' % mn)
986
1182
 
987
1183
 
1184
+ def _lanes_ok(mn, kind, lane):
1185
+ if kind == 'f' and lane not in ('4s', '2d') or kind == '' and lane != '16b' or \
1186
+ kind == 's' and lane == '2d' and mn in _NO2D:
1187
+ raise AssemblerError('%s has no .%s form' % (mn, lane))
1188
+
1189
+
988
1190
  def _i_vscalar(a, mn, ops):
989
1191
  """umov Wd, Vn.T[i]; dup Sd, Vn.s[i] (and Dd)."""
990
- e = _VELEM.match(ops[1].strip().lower())
991
- if e is None:
992
- raise AssemblerError('expected a vector element, got %r' % ops[1])
993
- imm5 = {'b': 1, 'h': 2, 's': 4, 'd': 8}[e[2]] | int(e[3]) << ({'b': 1, 'h': 2, 's': 3, 'd': 4}[e[2]])
994
- if mn == 'umov':
995
- r = _reg(ops[0], 'wx')
996
- return (0x4e003c00 if r[0] == 'x' else 0x0e003c00) | imm5 << 16 | int(e[1]) << 5 | r[1]
997
- r = _reg(ops[0], 'sd')
998
- return 0x5e000400 | imm5 << 16 | int(e[1]) << 5 | r[1]
1192
+ n, k, i = _elem(ops[1])
1193
+ imm5 = _imm5(k, i)
1194
+ if mn == 'umov': # an x register exactly for a .d element
1195
+ r = _reg(ops[0], 'x' if k == 'd' else 'w')
1196
+ return (0x4e003c00 if r[0] == 'x' else 0x0e003c00) | imm5 << 16 | n << 5 | r[1]
1197
+ r = _reg(ops[0], {'s': 's', 'd': 'd'}.get(k, 'sd'))
1198
+ if k not in 'sd':
1199
+ raise AssemblerError('dup to a scalar register takes .s or .d')
1200
+ return 0x5e000400 | imm5 << 16 | n << 5 | r[1]
999
1201
 
1000
1202
 
1001
1203
  def _i_ldst(a, mn, ops):
@@ -1195,12 +1397,22 @@ def _i_adrp(a, mn, ops):
1195
1397
  return 0x90000000 | rd[1]
1196
1398
 
1197
1399
 
1400
+ _SYSREGS = {'fpcr': 0x4400, 'fpsr': 0x4420} # op1=3, CRn=4, CRm=4, op2 0 or 1 (the floating-point environment)
1401
+
1402
+
1198
1403
  def _i_tls(a, mn, ops):
1404
+ """mrs Xt, fpcr|fpsr and msr fpcr|fpsr, Xt; other system registers (tpidr_el0: thread-local storage) are not
1405
+ supported"""
1406
+ if len(ops) == 2:
1407
+ sysreg, reg = (ops[1], ops[0]) if mn == 'mrs' else (ops[0], ops[1])
1408
+ if sysreg.lower() in _SYSREGS:
1409
+ rt = _reg(reg, 'x')
1410
+ return (0xd53b0000 if mn == 'mrs' else 0xd51b0000) | _SYSREGS[sysreg.lower()] | rt[1]
1199
1411
  raise AssemblerError('thread-local storage is not supported')
1200
1412
 
1201
1413
 
1202
1414
  _INSNS = {
1203
- 'add': _i_addsub, 'adds': _i_addsub, 'sub': _i_addsub, 'subs': _i_addsub,
1415
+ 'adc': _i_adc, 'add': _i_addsub, 'adds': _i_addsub, 'sub': _i_addsub, 'subs': _i_addsub,
1204
1416
  'cmp': _i_cmp, 'cmn': _i_cmp, 'neg': _i_neg,
1205
1417
  'and': _i_logic, 'orr': _i_logic, 'eor': _i_logic, 'ands': _i_logic,
1206
1418
  'bic': _i_logic, 'orn': _i_logic, 'eon': _i_logic, 'ubfx': _i_bitfield, 'sbfx': _i_bitfield,
@@ -1219,13 +1431,14 @@ _INSNS = {
1219
1431
  'frintm': _i_fneg, 'frintz': _i_fneg, 'frinta': _i_fneg, 'frintx': _i_fneg,
1220
1432
  'frinti': _i_fneg,
1221
1433
  'clz': _i_dp1, 'rbit': _i_dp1, 'rev16': _i_dp1, 'rev': _i_dp1, 'cnt': _i_simd,
1222
- 'addv': _i_simd,
1434
+ 'addv': _i_simd, 'ushll': _i_vcvt, 'xtn': _i_vcvt, 'sshll': _i_vcvt, 'sshll2': _i_vcvt, 'xtn2': _i_vcvt,
1435
+ 'tbl': _i_tbl, 'fcvtl': _i_vcvt, 'fcvtl2': _i_vcvt, 'fcvtn': _i_vcvt, 'fcvtn2': _i_vcvt, 'ld3': _i_bytes, 'umlal': _i_bytes, 'shrn': _i_bytes, 'umull2': _i_bytes, 'umlal2': _i_bytes, 'ushll2': _i_vcvt,
1223
1436
  'fmadd': _i_fp4, 'fmsub': _i_fp4, 'fnmadd': _i_fp4, 'fnmsub': _i_fp4,
1224
- 'fmov': _i_fmov, 'fcvt': _i_fcvt, 'fcvtzs': _i_fcvtz, 'fcvtzu': _i_fcvtz,
1225
- 'scvtf': _i_cvtf, 'ucvtf': _i_cvtf, 'fcmp': _i_fcmp, 'fcmpe': _i_fcmp,
1437
+ 'fmov': _i_fmov, 'fcvt': _i_fcvt, 'fcvtzs': _vector_or(_i_fcvtz), 'fcvtzu': _vector_or(_i_fcvtz),
1438
+ 'scvtf': _vector_or(_i_cvtf), 'ucvtf': _vector_or(_i_cvtf), 'fcmp': _i_fcmp, 'fcmpe': _i_fcmp,
1226
1439
  'ldp': _i_pair, 'stp': _i_pair,
1227
1440
  'b': _i_b, 'bl': _i_b, 'blr': _i_blr, 'br': _i_blr, 'ret': _i_ret,
1228
- 'brk': _i_brk, 'hint': _i_brk, 'nop': _i_nop, 'adrp': _i_adrp, 'mrs': _i_tls,
1441
+ 'brk': _i_brk, 'hint': _i_brk, 'nop': _i_nop, 'adrp': _i_adrp, 'mrs': _i_tls, 'msr': _i_tls,
1229
1442
  }
1230
1443
  for _k in _LDST:
1231
1444
  _INSNS[_k[0]] = _i_ldst
@@ -1382,6 +1595,15 @@ class _Asm:
1382
1595
  s.data += b
1383
1596
  s.size += len(b)
1384
1597
 
1598
+ def fill(self, unit, n):
1599
+ """n copies of unit: zeros in a nobits section only count (a `.zero` for a huge array in .bss)"""
1600
+ if self.sec.nobits and not any(unit):
1601
+ self.sec.size += len(unit) * max(n, 0)
1602
+ elif len(unit) * n > 1 << 32:
1603
+ raise AssemblerError('%d bytes of data: too large' % (len(unit) * n))
1604
+ else:
1605
+ self.emit(unit * n)
1606
+
1385
1607
  def align(self, n):
1386
1608
  if n <= 0 or n & (n - 1):
1387
1609
  raise AssemblerError('alignment must be a power of 2')
@@ -1413,6 +1635,23 @@ class _Asm:
1413
1635
 
1414
1636
  # driver
1415
1637
 
1638
+ far = frozenset() # the lines whose short branch can't reach its target: see farbranch
1639
+
1640
+ def farbranch(self, f, mn, ops):
1641
+ """b.cond, cbz or tbz to a target out of its reach (1 MB, 32 KB for tbz): the opposite test over a b"""
1642
+ if f is _i_b and mn not in ('b', 'bl'):
1643
+ c = _COND[mn[2:] if mn[1] == '.' else mn[1:]]
1644
+ inv = 'b.' + next(k for k, v in _COND.items() if v == c ^ 1)
1645
+ elif mn in ('cbz', 'cbnz', 'tbz', 'tbnz'):
1646
+ inv = {'cbz': 'cbnz', 'cbnz': 'cbz', 'tbz': 'tbnz', 'tbnz': 'tbz'}[mn]
1647
+ else:
1648
+ raise AssemblerError('branch out of range')
1649
+ skip = '.Lcimo_far%d' % self.lineno
1650
+ self.sec.align = max(self.sec.align, 4)
1651
+ self.emit(struct.pack('<I', f(self, inv, list(ops[:-1]) + [skip]))) # each fixup at its own offset
1652
+ self.emit(struct.pack('<I', _i_b(self, 'b', [ops[-1]])))
1653
+ self.label(skip)
1654
+
1416
1655
  def run(self, text):
1417
1656
  text = _strip_comments(text)
1418
1657
  insns = _INSNS
@@ -1450,7 +1689,12 @@ class _Asm:
1450
1689
  continue
1451
1690
  ops = _split(rest)
1452
1691
  f = insns.get(mn)
1453
- if _isneon(ops):
1692
+ if f is _i_bytes or f is _i_tbl or mn in _VCVT:
1693
+ if mn in _VCVT and ops and ops[0].strip().lower().startswith('v'):
1694
+ f = _i_vcvt
1695
+ elif mn in ('umull', 'umlal', 'umull2', 'umlal2') and ops and ops[0].strip().lower().startswith('v'):
1696
+ f = _i_bytes
1697
+ elif _isneon(ops):
1454
1698
  f = lambda a, mn, ops: _neon(mn, ops)
1455
1699
  elif mn in ('umov', 'dup') and ops:
1456
1700
  f = _i_vscalar
@@ -1458,6 +1702,9 @@ class _Asm:
1458
1702
  raise AssemblerError('unsupported instruction %r' % parts[0])
1459
1703
  if self.sec.nobits:
1460
1704
  raise AssemblerError('instruction in nobits section %s' % self.sec.name)
1705
+ if self.lineno in self.far:
1706
+ self.farbranch(f, mn, ops)
1707
+ continue
1461
1708
  word = f(self, mn, ops)
1462
1709
  if self.sec.size % 4:
1463
1710
  raise AssemblerError('misaligned instruction')
@@ -1527,11 +1774,11 @@ class _Asm:
1527
1774
  if size > 8 or size < 0:
1528
1775
  raise AssemblerError('.fill size must be at most 8')
1529
1776
  unit = struct.pack('<Q', val & M64)[:min(size, 4)].ljust(size, b'\0')
1530
- self.emit(unit * n)
1777
+ self.fill(unit, n)
1531
1778
  else:
1532
1779
  n = _int(args[0])
1533
1780
  val = _imm(args[1]) if len(args) > 1 else 0
1534
- self.emit(bytes([val & 0xff]) * n)
1781
+ self.fill(bytes([val & 0xff]), n)
1535
1782
  elif d == '.comm':
1536
1783
  args = _split(rest)
1537
1784
  if len(args) not in (2, 3):
@@ -1589,6 +1836,7 @@ class _Asm:
1589
1836
  """Resolve branches to non-global labels of the same section (as GNU as does) and turn
1590
1837
  everything else into relocations."""
1591
1838
  syms = self.obj.symbols
1839
+ far = set()
1592
1840
  for sec, off, kind, name, add, lineno in self.fixups:
1593
1841
  s = syms.get(name)
1594
1842
  if s is None:
@@ -1599,7 +1847,10 @@ class _Asm:
1599
1847
  raise AssemblerError('line %d: misaligned branch target %s' % (lineno, name))
1600
1848
  bits = {'CONDBR19': 19, 'TSTBR14': 14}.get(kind, 26) # tbz: 32 KB either way
1601
1849
  if not -(1 << (bits + 1)) <= d < 1 << (bits + 1):
1602
- raise AssemblerError('line %d: branch out of range: %s' % (lineno, name))
1850
+ if bits == 26 or lineno in self.far:
1851
+ raise AssemblerError('line %d: branch out of range: %s' % (lineno, name))
1852
+ far.add(lineno)
1853
+ continue
1603
1854
  w = struct.unpack_from('<I', sec.data, off)[0]
1604
1855
  if bits == 26:
1605
1856
  w |= (d >> 2) & 0x3ffffff
@@ -1608,9 +1859,27 @@ class _Asm:
1608
1859
  struct.pack_into('<I', sec.data, off, w)
1609
1860
  else:
1610
1861
  sec.relocs.append(Reloc(off, kind, name, add))
1862
+ if far:
1863
+ raise _Far(far)
1864
+
1865
+
1866
+ class _Far(AssemblerError):
1867
+ """Short branches out of reach, on these lines: assemble() runs again with them made long."""
1868
+
1869
+ def __init__(self, lines):
1870
+ AssemblerError.__init__(self, 'branch out of range on line %d' % min(lines))
1871
+ self.lines = lines
1611
1872
 
1612
1873
 
1613
1874
  def assemble(text, syntax='elf'):
1614
1875
  """Assemble arm64 GNU-syntax assembly text into an Object. syntax: 'elf' (QBE target
1615
- arm64) or 'macho' (arm64_apple)."""
1616
- return _Asm(syntax).run(text)
1876
+ arm64) or 'macho' (arm64_apple). A b.cond, cbz or tbz that can't reach its target is assembled again as the
1877
+ opposite test over a b (as LLVM's branch relaxation does)."""
1878
+ far = set()
1879
+ while True:
1880
+ a = _Asm(syntax)
1881
+ a.far = frozenset(far)
1882
+ try:
1883
+ return a.run(text)
1884
+ except _Far as e:
1885
+ far |= e.lines