* x64: Add precise-output tests for div traps
This adds a suite of `*.clif` files which are intended to test the
`avoid_div_traps=true` compilation of the `{s,u}{div,rem}` instructions.
* x64: Remove conditional regalloc in `Div` instruction
Move the 8-bit `Div` logic into a dedicated `Div8` instruction to avoid
having conditionally-used registers with respect to regalloc.
* x64: Migrate non-trapping, `udiv`/`urem` to ISLE
* x64: Port checked `udiv` to ISLE
* x64: Migrate urem entirely to ISLE
* x64: Use `test` instead of `cmp` to compare-to-zero
* x64: Port `sdiv` lowering to ISLE
* x64: Port `srem` lowering to ISLE
* Tidy up regalloc behavior and fix tests
* Update docs and winch
* Review comments
* Reword again
* More refactoring test fixes
* More test fixes
22 lines
641 B
Plaintext
22 lines
641 B
Plaintext
;;! target = "x86_64"
|
|
|
|
(module
|
|
(func (result i64)
|
|
(i64.const -1)
|
|
(i64.const -1)
|
|
(i64.rem_u)
|
|
)
|
|
)
|
|
;; 0: 55 push rbp
|
|
;; 1: 4889e5 mov rbp, rsp
|
|
;; 4: 48c7c1ffffffff mov rcx, 0xffffffffffffffff
|
|
;; b: 48c7c0ffffffff mov rax, 0xffffffffffffffff
|
|
;; 12: 4883f900 cmp rcx, 0
|
|
;; 16: 0f8502000000 jne 0x1e
|
|
;; 1c: 0f0b ud2
|
|
;; 1e: 4831d2 xor rdx, rdx
|
|
;; 21: 48f7f1 div rcx
|
|
;; 24: 4889d0 mov rax, rdx
|
|
;; 27: 5d pop rbp
|
|
;; 28: c3 ret
|