x64: Migrate the return and fallthrough_return lowerings to ISLE (#4518)

https://github.com/bytecodealliance/wasmtime/pull/4518
This commit is contained in:
Trevor Elliott
2022-07-25 14:28:52 -07:00
committed by GitHub
parent 89f9de7cc3
commit 9e9e043174
6 changed files with 85 additions and 21 deletions

View File

@@ -1443,6 +1443,22 @@
(rule (lower (resumable_trap code))
(side_effect (x64_ud2 code)))
;;;; Rules for `return` and `fallthrough_return` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; N.B.: the Ret itself is generated by the ABI.
(rule (lower (return args))
(lower_return (range 0 (value_slice_len args)) args))
(rule (lower (fallthrough_return args))
(lower_return (range 0 (value_slice_len args)) args))
(decl lower_return (Range ValueSlice) InstOutput)
(rule (lower_return (range_empty) _) (output_none))
(rule (lower_return (range_unwrap head tail) args)
(let ((_ Unit (copy_to_regs (retval head) (value_slice_get args head))))
(lower_return tail args)))
;;;; Rules for `icmp` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; For GPR-held values we only need to emit `CMP + SETCC`. We rely here on