Files
wasmtime/winch/filetests/filetests/x64/i64_remu/const.wat
Alex Crichton 5c1b468648 x64: Migrate {s,u}{div,rem} to ISLE (#6008)
* 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
2023-03-14 01:44:06 +00:00

22 lines
605 B
Plaintext

;;! target = "x86_64"
(module
(func (result i64)
(i64.const 7)
(i64.const 5)
(i64.rem_u)
)
)
;; 0: 55 push rbp
;; 1: 4889e5 mov rbp, rsp
;; 4: 48c7c105000000 mov rcx, 5
;; b: 48c7c007000000 mov rax, 7
;; 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