Remove trapif and trapff (#5162)

This branch removes the trapif and trapff instructions, in favor of using an explicit comparison and trapnz. This moves us closer to removing iflags and fflags, but introduces the need to implement instructions like iadd_cout in the x64 and aarch64 backends.
This commit is contained in:
Trevor Elliott
2022-11-03 09:25:11 -07:00
committed by GitHub
parent 311b01875f
commit aeceea28e2
19 changed files with 30 additions and 215 deletions

View File

@@ -845,25 +845,6 @@
(vec_writable_to_regs dst)))
;;;;; Rules for `trapif`;;;;;;;;;
(rule
(lower (trapif cc (ifcmp a @ (value_type ty) b) trap_code))
(let
((test Reg (lower_icmp cc a b ty)))
(gen_trapif test trap_code)))
(rule
(lower (trapif _ (iadd_ifcout a @ (value_type ty) b) trap_code))
(let
((res ValueRegs (lower_uadd_overflow a b ty)))
(gen_trapif (value_regs_get res 1) trap_code)))
;;;;; Rules for `trapff`;;;;;;;;;
(rule
(lower (trapff cc (ffcmp a @ (value_type ty) b) trap_code))
(gen_trapff cc a b ty trap_code))
;;;;; Rules for `bmask`;;;;;;;;;
(rule
(lower (has_type oty (bmask x @ (value_type ity))))