cimo 0.0.3__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.
- {cimo-0.0.3 → cimo-0.0.4}/PKG-INFO +1 -1
- {cimo-0.0.3 → cimo-0.0.4}/cimo/__init__.py +2 -2
- {cimo-0.0.3 → cimo-0.0.4}/cimo/assembler.py +314 -50
- {cimo-0.0.3 → cimo-0.0.4}/cimo/assembler_amd64.py +304 -19
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/PORTING.md +31 -1
- cimo-0.0.4/cimo/backend/abislot.py +115 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/amd64/emit.py +542 -13
- cimo-0.0.4/cimo/backend/amd64/fmachain.py +119 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/amd64/isel.py +183 -15
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/amd64/qlower.py +58 -4
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/amd64/sysv.py +62 -12
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/amd64/targ.py +2 -2
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/amd64/winabi.py +67 -13
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/arm64/abi.py +16 -5
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/arm64/emit.py +275 -11
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/arm64/isel.py +74 -15
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/arm64/pair.py +2 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/arm64/targ.py +2 -2
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/cfg.py +11 -10
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/cse.py +2 -2
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/defs.py +91 -8
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/emit.py +15 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/ext.py +17 -1
- cimo-0.0.4/cimo/backend/fmashare.py +97 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/fold.py +72 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/gcm.py +16 -1
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/gvn.py +8 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/ifopt.py +38 -4
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/inline.py +201 -24
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/load.py +18 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/main.py +54 -1
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/mem.py +40 -4
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/nowrap.py +7 -1
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/parse.py +64 -13
- cimo-0.0.4/cimo/backend/remat.py +176 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/spill.py +13 -3
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/sroa.py +6 -1
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/util.py +2 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/wasm/emit.py +25 -2
- {cimo-0.0.3 → cimo-0.0.4}/cimo/cli/commands.py +16 -7
- {cimo-0.0.3 → cimo-0.0.4}/cimo/cli/completion.py +9 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/cli/parse.py +9 -8
- {cimo-0.0.3 → cimo-0.0.4}/cimo/cli/term.py +9 -3
- cimo-0.0.4/cimo/cpu.py +116 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/driver.py +448 -64
- {cimo-0.0.3 → cimo-0.0.4}/cimo/execution.py +225 -32
- cimo-0.0.4/cimo/fault.py +532 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/PORTING.md +21 -2
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/attr.py +15 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/cc.py +18 -6
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/decl.py +113 -12
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/diag.py +64 -14
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/eval.py +241 -7
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/expr.py +357 -18
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/init.py +83 -7
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/main.py +20 -1
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/pp.py +79 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/qbe.py +1245 -37
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/scan.py +7 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/scope.py +6 -1
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/stmt.py +208 -8
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/type.py +115 -2
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/util.py +18 -0
- cimo-0.0.4/cimo/include/complex.h +64 -0
- cimo-0.0.4/cimo/include/fenv.h +50 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/float.h +49 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/math.h +1 -0
- cimo-0.0.4/cimo/include/setjmp.h +15 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/linker.py +50 -11
- {cimo-0.0.3 → cimo-0.0.4}/cimo/loader.py +16 -2
- cimo-0.0.4/cimo/middle/earlyexit.py +317 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/middle/ifconv.py +36 -4
- {cimo-0.0.3 → cimo-0.0.4}/cimo/middle/inner.py +276 -43
- {cimo-0.0.3 → cimo-0.0.4}/cimo/middle/ir.py +11 -3
- {cimo-0.0.3 → cimo-0.0.4}/cimo/middle/jam.py +45 -46
- cimo-0.0.4/cimo/middle/outer.py +373 -0
- cimo-0.0.4/cimo/middle/pipeline.py +174 -0
- cimo-0.0.4/cimo/middle/stride.py +92 -0
- cimo-0.0.4/cimo/middle/tile.py +273 -0
- cimo-0.0.4/cimo/middle/unswitch.py +303 -0
- cimo-0.0.4/cimo/middle/vectorize.py +1787 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/preprocessor.py +16 -3
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/COPYRIGHT +2 -0
- cimo-0.0.4/cimo/runtime/builtins.c +447 -0
- cimo-0.0.4/cimo/runtime/complex/__cexp.c +87 -0
- cimo-0.0.4/cimo/runtime/complex/__cexpf.c +68 -0
- cimo-0.0.4/cimo/runtime/complex/__cimo_carith.c +129 -0
- cimo-0.0.4/cimo/runtime/complex/cabs.c +6 -0
- cimo-0.0.4/cimo/runtime/complex/cabsf.c +6 -0
- cimo-0.0.4/cimo/runtime/complex/cacos.c +11 -0
- cimo-0.0.4/cimo/runtime/complex/cacosf.c +11 -0
- cimo-0.0.4/cimo/runtime/complex/cacosh.c +12 -0
- cimo-0.0.4/cimo/runtime/complex/cacoshf.c +10 -0
- cimo-0.0.4/cimo/runtime/complex/carg.c +6 -0
- cimo-0.0.4/cimo/runtime/complex/cargf.c +6 -0
- cimo-0.0.4/cimo/runtime/complex/casin.c +17 -0
- cimo-0.0.4/cimo/runtime/complex/casinf.c +15 -0
- cimo-0.0.4/cimo/runtime/complex/casinh.c +9 -0
- cimo-0.0.4/cimo/runtime/complex/casinhf.c +7 -0
- cimo-0.0.4/cimo/runtime/complex/catan.c +107 -0
- cimo-0.0.4/cimo/runtime/complex/catanf.c +105 -0
- cimo-0.0.4/cimo/runtime/complex/catanh.c +9 -0
- cimo-0.0.4/cimo/runtime/complex/catanhf.c +7 -0
- cimo-0.0.4/cimo/runtime/complex/ccos.c +8 -0
- cimo-0.0.4/cimo/runtime/complex/ccosf.c +6 -0
- cimo-0.0.4/cimo/runtime/complex/ccosh.c +140 -0
- cimo-0.0.4/cimo/runtime/complex/ccoshf.c +90 -0
- cimo-0.0.4/cimo/runtime/complex/cexp.c +83 -0
- cimo-0.0.4/cimo/runtime/complex/cexpf.c +83 -0
- cimo-0.0.4/cimo/runtime/complex/cimag.c +6 -0
- cimo-0.0.4/cimo/runtime/complex/cimagf.c +6 -0
- cimo-0.0.4/cimo/runtime/complex/clog.c +14 -0
- cimo-0.0.4/cimo/runtime/complex/clogf.c +12 -0
- cimo-0.0.4/cimo/runtime/complex/conj.c +6 -0
- cimo-0.0.4/cimo/runtime/complex/conjf.c +6 -0
- cimo-0.0.4/cimo/runtime/complex/cpow.c +8 -0
- cimo-0.0.4/cimo/runtime/complex/cpowf.c +6 -0
- cimo-0.0.4/cimo/runtime/complex/cproj.c +8 -0
- cimo-0.0.4/cimo/runtime/complex/cprojf.c +8 -0
- cimo-0.0.4/cimo/runtime/complex/creal.c +6 -0
- cimo-0.0.4/cimo/runtime/complex/crealf.c +6 -0
- cimo-0.0.4/cimo/runtime/complex/csin.c +9 -0
- cimo-0.0.4/cimo/runtime/complex/csinf.c +7 -0
- cimo-0.0.4/cimo/runtime/complex/csinh.c +141 -0
- cimo-0.0.4/cimo/runtime/complex/csinhf.c +90 -0
- cimo-0.0.4/cimo/runtime/complex/csqrt.c +100 -0
- cimo-0.0.4/cimo/runtime/complex/csqrtf.c +82 -0
- cimo-0.0.4/cimo/runtime/complex/ctan.c +9 -0
- cimo-0.0.4/cimo/runtime/complex/ctanf.c +7 -0
- cimo-0.0.4/cimo/runtime/complex/ctanh.c +129 -0
- cimo-0.0.4/cimo/runtime/complex/ctanhf.c +66 -0
- cimo-0.0.4/cimo/runtime/fenv.c +102 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/heap.c +70 -7
- cimo-0.0.4/cimo/runtime/internal/complex_impl.h +16 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/softfma.h +55 -23
- cimo-0.0.4/cimo/runtime/math/hypot.c +61 -0
- cimo-0.0.4/cimo/runtime/pyentry.c +177 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/symbols.txt +50 -1
- {cimo-0.0.3 → cimo-0.0.4}/cimo/wasm/__init__.py +9 -4
- {cimo-0.0.3 → cimo-0.0.4}/cimo/wasm/link.py +3 -1
- {cimo-0.0.3 → cimo-0.0.4}/cimo/wasm/pyodide.py +48 -6
- cimo-0.0.4/cimo/wat.py +226 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo.egg-info/PKG-INFO +1 -1
- {cimo-0.0.3 → cimo-0.0.4}/cimo.egg-info/SOURCES.txt +80 -0
- {cimo-0.0.3 → cimo-0.0.4}/pyproject.toml +1 -1
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_abi.py +119 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_amd64_fixes.py +38 -1
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_assembler.py +63 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_assembler_amd64.py +24 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_cli.py +26 -2
- cimo-0.0.4/tests/test_compile_time.py +88 -0
- cimo-0.0.4/tests/test_complex.py +59 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_corpora.py +31 -13
- cimo-0.0.4/tests/test_cpu.py +42 -0
- cimo-0.0.4/tests/test_cross_module.py +57 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_cse.py +12 -1
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_diagnostics.py +17 -20
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_execution.py +29 -1
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_ext_kernels.py +13 -1
- cimo-0.0.4/tests/test_fastcall.py +144 -0
- cimo-0.0.4/tests/test_faults.py +434 -0
- cimo-0.0.4/tests/test_fenv.py +256 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_fma.py +72 -9
- cimo-0.0.4/tests/test_gnu_extensions.py +33 -0
- cimo-0.0.4/tests/test_half.py +54 -0
- cimo-0.0.4/tests/test_half_hw.py +78 -0
- cimo-0.0.4/tests/test_hostlibm.py +96 -0
- cimo-0.0.4/tests/test_inline.py +288 -0
- cimo-0.0.4/tests/test_int128.py +122 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_isel.py +29 -3
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_middle.py +1 -1
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_preprocessor.py +3 -2
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_regressions.py +275 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_runtime.py +94 -7
- cimo-0.0.4/tests/test_setjmp.py +89 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_simplify.py +36 -2
- cimo-0.0.4/tests/test_site.py +56 -0
- cimo-0.0.4/tests/test_threads.py +175 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_vector.py +102 -35
- cimo-0.0.4/tests/test_vector_q.py +360 -0
- cimo-0.0.4/tests/test_vectorize.py +1233 -0
- cimo-0.0.4/tests/test_vectors.py +30 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_wasm.py +96 -7
- cimo-0.0.3/cimo/middle/pipeline.py +0 -82
- cimo-0.0.3/cimo/middle/unswitch.py +0 -148
- cimo-0.0.3/cimo/middle/vectorize.py +0 -461
- cimo-0.0.3/cimo/runtime/builtins.c +0 -173
- cimo-0.0.3/cimo/runtime/math/hypot.c +0 -67
- cimo-0.0.3/tests/test_inline.py +0 -140
- cimo-0.0.3/tests/test_site.py +0 -16
- cimo-0.0.3/tests/test_vectorize.py +0 -459
- {cimo-0.0.3 → cimo-0.0.4}/LICENSE +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/README.md +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/__main__.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/LICENSE +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/__init__.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/__main__.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/abi.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/alias.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/amd64/__init__.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/amd64/regs.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/arm64/__init__.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/arm64/regs.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/copy.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/live.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/memopt.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/rega.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/scalar.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/simpl.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/simplify.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/ssa.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/thread.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/wasm/__init__.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/wasm/obj.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/backend/wasm/targ.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/cli/__init__.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/cli/report.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/LICENSE +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/__init__.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/__main__.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/map.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/prune.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/targ.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/token.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/tree.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/frontend/utf.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/assert.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/ctype.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/inttypes.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/iso646.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/limits.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/stdalign.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/stdarg.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/stdbool.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/stddef.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/stdint.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/stdio.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/stdlib.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/stdnoreturn.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/include/string.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/introspect.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/middle/__init__.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/middle/affine.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/middle/loops.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/middle/memdep.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/onefile.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/py.typed +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/resources.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/abort.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/ctype/ctype.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/endian.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/errno.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/exp2f_data.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/exp_data.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/fenv.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/floatscan.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/intscan.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/libm.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/log2_data.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/log2f_data.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/log_data.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/logf_data.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/musl.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/pow_data.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/powf_data.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/shgetc.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/sqrt_data.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/stdio_impl.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/internal/string.h +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__cos.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__cosdf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__expo2.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__expo2f.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__math_divzero.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__math_divzerof.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__math_invalid.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__math_invalidf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__math_oflow.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__math_oflowf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__math_uflow.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__math_uflowf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__math_xflow.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__math_xflowf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__rem_pio2.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__rem_pio2_large.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__rem_pio2f.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__sin.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__sindf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__tan.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/__tandf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/acos.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/acosf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/acosh.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/acoshf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/asin.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/asinf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/asinh.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/asinhf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/atan.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/atan2.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/atan2f.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/atanf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/atanh.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/atanhf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/cbrt.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/cbrtf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/ceil.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/ceilf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/copysign.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/copysignf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/cos.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/cosf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/cosh.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/coshf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/erf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/erff.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/exp.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/exp2.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/exp2f.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/exp2f_data.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/exp_data.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/expf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/expm1.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/expm1f.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/fabs.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/fabsf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/fdim.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/fdimf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/floor.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/floorf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/fma.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/fmaf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/fmax.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/fmaxf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/fmin.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/fminf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/fmod.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/fmodf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/frexp.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/frexpf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/hypotf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/ilogb.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/ilogbf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/ldexp.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/ldexpf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/lgamma.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/lgamma_r.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/lgammaf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/lgammaf_r.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/llrint.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/llrintf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/llround.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/llroundf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/log.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/log10.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/log10f.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/log1p.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/log1pf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/log2.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/log2_data.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/log2f.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/log2f_data.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/log_data.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/logb.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/logbf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/logf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/logf_data.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/lrint.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/lrintf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/lround.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/lroundf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/modf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/modff.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/nan.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/nanf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/nearbyint.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/nearbyintf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/nextafter.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/nextafterf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/pow.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/pow_data.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/powf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/powf_data.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/remainder.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/remainderf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/remquo.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/remquof.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/rint.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/rintf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/round.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/roundf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/scalbln.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/scalblnf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/scalbn.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/scalbnf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/signgam.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/sin.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/sinf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/sinh.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/sinhf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/sqrt.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/sqrtf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/tan.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/tanf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/tanh.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/tanhf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/tgamma.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/tgammaf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/trunc.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/math/truncf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdio/snprintf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdio/stdout.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdio/vfprintf.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/abs.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/atof.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/atoi.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/atol.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/atoll.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/bsearch.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/div.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/floatscan.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/intscan.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/inttypes.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/labs.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/ldiv.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/llabs.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/lldiv.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/qsort.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/qsort_nr.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/rand.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/strtod.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/stdlib/strtol.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/memchr.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/memcmp.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/memcpy.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/memmove.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/memrchr.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/memset.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/stpcpy.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/stpncpy.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strcat.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strchr.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strchrnul.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strcmp.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strcoll.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strcpy.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strcspn.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strdup.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strerror.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strlen.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strncat.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strncmp.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strncpy.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strndup.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strnlen.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strpbrk.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strrchr.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strspn.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strstr.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strtok.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/runtime/string/strxfrm.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo/wasm/runtime/fma.c +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo.egg-info/dependency_links.txt +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo.egg-info/entry_points.txt +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo.egg-info/requires.txt +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/cimo.egg-info/top_level.txt +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/setup.cfg +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_backend_edges.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_backend_fold.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_bench_gate.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_constraints.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_frontend.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_gcm_order.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_introspect.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_ldp_layout.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_loader.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_loader_amd64.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_m2.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_macos.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_middle_random.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_nowrap.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_onefile.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_passes_matter.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_semantics.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_thread_loops.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_typing.py +0 -0
- {cimo-0.0.3 → cimo-0.0.4}/tests/test_windows.py +0 -0
|
@@ -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 &
|
|
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], '
|
|
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
|
-
|
|
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,13 +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
1083
|
_NEONW = {'saddw': 0x0ea01000, 'saddw2': 0x4ea01000, 'uaddw': 0x2ea01000, 'uaddw2': 0x6ea01000} # 2d, 2d, 2s or 4s
|
|
939
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
|
|
940
1086
|
_VELEM = re.compile(r'v(\d+)\.([bhsd])\[(\d+)\]$')
|
|
941
1087
|
|
|
942
1088
|
|
|
@@ -944,63 +1090,114 @@ def _isneon(ops):
|
|
|
944
1090
|
return bool(ops) and ops[0].strip().lower()[:1] == 'v' and _VREG.match(ops[0].strip().lower()) is not None
|
|
945
1091
|
|
|
946
1092
|
|
|
947
|
-
def _v(s):
|
|
948
|
-
|
|
949
|
-
|
|
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:
|
|
950
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))
|
|
951
1100
|
return int(m[1]), m[2]
|
|
952
1101
|
|
|
953
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
|
+
|
|
954
1121
|
def _neon(mn, ops):
|
|
955
|
-
"""The word of a NEON instruction whose first operand is a vector register.
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
n, _ = _v(ops[1])
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
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
|
|
965
1141
|
if mn == 'dup':
|
|
1142
|
+
d, lane = _v(ops[0], _LANES)
|
|
1143
|
+
size = _LANES[lane]
|
|
966
1144
|
s = ops[1].strip().lower()
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
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')
|
|
972
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
|
|
973
1160
|
if mn in _NEONSH:
|
|
974
|
-
n, _ = _v(ops[1])
|
|
1161
|
+
n, _ = _v(ops[1], same)
|
|
975
1162
|
amount = _imm(ops[2], True)
|
|
976
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))
|
|
977
1166
|
immhb = bits + amount if mn == 'shl' else 2 * bits - amount
|
|
978
1167
|
return _NEONSH[mn] | immhb << 16 | n << 5 | d
|
|
979
1168
|
if mn in _NEON2:
|
|
980
1169
|
op, kind = _NEON2[mn]
|
|
981
|
-
|
|
1170
|
+
_lanes_ok(mn, kind, lane)
|
|
1171
|
+
n, _ = _v(ops[1], same)
|
|
982
1172
|
w = op | n << 5 | d
|
|
983
1173
|
return w | (size << 22 if kind == 's' else (lane == '2d') << 22 if kind == 'f' else 0)
|
|
984
1174
|
if mn in _NEON3:
|
|
985
1175
|
op, kind = _NEON3[mn]
|
|
986
|
-
|
|
987
|
-
|
|
1176
|
+
_lanes_ok(mn, kind, lane)
|
|
1177
|
+
n, _ = _v(ops[1], same)
|
|
1178
|
+
m, _ = _v(ops[2], same)
|
|
988
1179
|
w = op | m << 16 | n << 5 | d
|
|
989
1180
|
return w | (size << 22 if kind == 's' else (lane == '2d') << 22 if kind == 'f' else 0)
|
|
990
1181
|
raise AssemblerError('unsupported vector instruction %r' % mn)
|
|
991
1182
|
|
|
992
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
|
+
|
|
993
1190
|
def _i_vscalar(a, mn, ops):
|
|
994
1191
|
"""umov Wd, Vn.T[i]; dup Sd, Vn.s[i] (and Dd)."""
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
return 0x5e000400 | imm5 << 16 |
|
|
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]
|
|
1004
1201
|
|
|
1005
1202
|
|
|
1006
1203
|
def _i_ldst(a, mn, ops):
|
|
@@ -1200,12 +1397,22 @@ def _i_adrp(a, mn, ops):
|
|
|
1200
1397
|
return 0x90000000 | rd[1]
|
|
1201
1398
|
|
|
1202
1399
|
|
|
1400
|
+
_SYSREGS = {'fpcr': 0x4400, 'fpsr': 0x4420} # op1=3, CRn=4, CRm=4, op2 0 or 1 (the floating-point environment)
|
|
1401
|
+
|
|
1402
|
+
|
|
1203
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]
|
|
1204
1411
|
raise AssemblerError('thread-local storage is not supported')
|
|
1205
1412
|
|
|
1206
1413
|
|
|
1207
1414
|
_INSNS = {
|
|
1208
|
-
'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,
|
|
1209
1416
|
'cmp': _i_cmp, 'cmn': _i_cmp, 'neg': _i_neg,
|
|
1210
1417
|
'and': _i_logic, 'orr': _i_logic, 'eor': _i_logic, 'ands': _i_logic,
|
|
1211
1418
|
'bic': _i_logic, 'orn': _i_logic, 'eon': _i_logic, 'ubfx': _i_bitfield, 'sbfx': _i_bitfield,
|
|
@@ -1224,13 +1431,14 @@ _INSNS = {
|
|
|
1224
1431
|
'frintm': _i_fneg, 'frintz': _i_fneg, 'frinta': _i_fneg, 'frintx': _i_fneg,
|
|
1225
1432
|
'frinti': _i_fneg,
|
|
1226
1433
|
'clz': _i_dp1, 'rbit': _i_dp1, 'rev16': _i_dp1, 'rev': _i_dp1, 'cnt': _i_simd,
|
|
1227
|
-
'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,
|
|
1228
1436
|
'fmadd': _i_fp4, 'fmsub': _i_fp4, 'fnmadd': _i_fp4, 'fnmsub': _i_fp4,
|
|
1229
|
-
'fmov': _i_fmov, 'fcvt': _i_fcvt, 'fcvtzs': _i_fcvtz, 'fcvtzu': _i_fcvtz,
|
|
1230
|
-
'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,
|
|
1231
1439
|
'ldp': _i_pair, 'stp': _i_pair,
|
|
1232
1440
|
'b': _i_b, 'bl': _i_b, 'blr': _i_blr, 'br': _i_blr, 'ret': _i_ret,
|
|
1233
|
-
'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,
|
|
1234
1442
|
}
|
|
1235
1443
|
for _k in _LDST:
|
|
1236
1444
|
_INSNS[_k[0]] = _i_ldst
|
|
@@ -1387,6 +1595,15 @@ class _Asm:
|
|
|
1387
1595
|
s.data += b
|
|
1388
1596
|
s.size += len(b)
|
|
1389
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
|
+
|
|
1390
1607
|
def align(self, n):
|
|
1391
1608
|
if n <= 0 or n & (n - 1):
|
|
1392
1609
|
raise AssemblerError('alignment must be a power of 2')
|
|
@@ -1418,6 +1635,23 @@ class _Asm:
|
|
|
1418
1635
|
|
|
1419
1636
|
# driver
|
|
1420
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
|
+
|
|
1421
1655
|
def run(self, text):
|
|
1422
1656
|
text = _strip_comments(text)
|
|
1423
1657
|
insns = _INSNS
|
|
@@ -1455,7 +1689,12 @@ class _Asm:
|
|
|
1455
1689
|
continue
|
|
1456
1690
|
ops = _split(rest)
|
|
1457
1691
|
f = insns.get(mn)
|
|
1458
|
-
if
|
|
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):
|
|
1459
1698
|
f = lambda a, mn, ops: _neon(mn, ops)
|
|
1460
1699
|
elif mn in ('umov', 'dup') and ops:
|
|
1461
1700
|
f = _i_vscalar
|
|
@@ -1463,6 +1702,9 @@ class _Asm:
|
|
|
1463
1702
|
raise AssemblerError('unsupported instruction %r' % parts[0])
|
|
1464
1703
|
if self.sec.nobits:
|
|
1465
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
|
|
1466
1708
|
word = f(self, mn, ops)
|
|
1467
1709
|
if self.sec.size % 4:
|
|
1468
1710
|
raise AssemblerError('misaligned instruction')
|
|
@@ -1532,11 +1774,11 @@ class _Asm:
|
|
|
1532
1774
|
if size > 8 or size < 0:
|
|
1533
1775
|
raise AssemblerError('.fill size must be at most 8')
|
|
1534
1776
|
unit = struct.pack('<Q', val & M64)[:min(size, 4)].ljust(size, b'\0')
|
|
1535
|
-
self.
|
|
1777
|
+
self.fill(unit, n)
|
|
1536
1778
|
else:
|
|
1537
1779
|
n = _int(args[0])
|
|
1538
1780
|
val = _imm(args[1]) if len(args) > 1 else 0
|
|
1539
|
-
self.
|
|
1781
|
+
self.fill(bytes([val & 0xff]), n)
|
|
1540
1782
|
elif d == '.comm':
|
|
1541
1783
|
args = _split(rest)
|
|
1542
1784
|
if len(args) not in (2, 3):
|
|
@@ -1594,6 +1836,7 @@ class _Asm:
|
|
|
1594
1836
|
"""Resolve branches to non-global labels of the same section (as GNU as does) and turn
|
|
1595
1837
|
everything else into relocations."""
|
|
1596
1838
|
syms = self.obj.symbols
|
|
1839
|
+
far = set()
|
|
1597
1840
|
for sec, off, kind, name, add, lineno in self.fixups:
|
|
1598
1841
|
s = syms.get(name)
|
|
1599
1842
|
if s is None:
|
|
@@ -1604,7 +1847,10 @@ class _Asm:
|
|
|
1604
1847
|
raise AssemblerError('line %d: misaligned branch target %s' % (lineno, name))
|
|
1605
1848
|
bits = {'CONDBR19': 19, 'TSTBR14': 14}.get(kind, 26) # tbz: 32 KB either way
|
|
1606
1849
|
if not -(1 << (bits + 1)) <= d < 1 << (bits + 1):
|
|
1607
|
-
|
|
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
|
|
1608
1854
|
w = struct.unpack_from('<I', sec.data, off)[0]
|
|
1609
1855
|
if bits == 26:
|
|
1610
1856
|
w |= (d >> 2) & 0x3ffffff
|
|
@@ -1613,9 +1859,27 @@ class _Asm:
|
|
|
1613
1859
|
struct.pack_into('<I', sec.data, off, w)
|
|
1614
1860
|
else:
|
|
1615
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
|
|
1616
1872
|
|
|
1617
1873
|
|
|
1618
1874
|
def assemble(text, syntax='elf'):
|
|
1619
1875
|
"""Assemble arm64 GNU-syntax assembly text into an Object. syntax: 'elf' (QBE target
|
|
1620
|
-
arm64) or 'macho' (arm64_apple).
|
|
1621
|
-
|
|
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
|