riscv64: Move is_null/is_invalid to ISLE (#5874)
* riscv64: Move `is_null`/`is_invalid` to ISLE * riscv64: Fix `is_invalid` codegen * Implement review suggestions Thanks! Co-authored-by: Jamey Sharp <jamey@minilop.net> --------- Co-authored-by: Jamey Sharp <jamey@minilop.net>
This commit is contained in:
@@ -612,14 +612,16 @@
|
||||
(gen_stack_addr ss offset))
|
||||
|
||||
;;;;; Rules for `is_null`;;;;;;;;;
|
||||
(rule
|
||||
(lower (is_null v))
|
||||
(gen_reference_check (ReferenceCheckOP.IsNull) v))
|
||||
|
||||
;; Null references are represented by the constant value `0`.
|
||||
(rule (lower (is_null v))
|
||||
(seqz v))
|
||||
|
||||
;;;;; Rules for `is_invalid`;;;;;;;;;
|
||||
(rule
|
||||
(lower (is_invalid v))
|
||||
(gen_reference_check (ReferenceCheckOP.IsInvalid) v))
|
||||
|
||||
;; Invalid references are represented by the constant value `-1`.
|
||||
(rule (lower (is_invalid v))
|
||||
(seqz (alu_rr_imm12 (AluOPRRI.Addi) v (imm12_const 1))))
|
||||
|
||||
;;;;; Rules for `select`;;;;;;;;;
|
||||
(rule
|
||||
|
||||
Reference in New Issue
Block a user