Cranelift AArch64: Use an allocated encoding for Udf (#4281)

Preserve the current behaviour when code is generated for SpiderMonkey.

Copyright (c) 2022, Arm Limited.
This commit is contained in:
Anton Kirilov
2022-06-22 15:03:28 +01:00
committed by GitHub
parent 2f9d96cd00
commit 25a588c35f
11 changed files with 87 additions and 30 deletions

View File

@@ -695,6 +695,7 @@
;; An instruction guaranteed to always be undefined and to trigger an illegal instruction at
;; runtime.
(Udf
(use_allocated_encoding bool)
(trap_code TrapCode))
;; Compute the address (using a PC-relative offset) of a memory location, using the `ADR`
@@ -1905,6 +1906,12 @@
(_2 Unit (emit (MInst.VecRRR (VecALUOp.Bsl) dst x y (vector_size ty)))))
dst))
;; Helper for generating a `udf` instruction.
(decl udf (bool TrapCode) SideEffectNoResult)
(rule (udf use_allocated_encoding trap_code)
(SideEffectNoResult.Inst (MInst.Udf use_allocated_encoding trap_code)))
;; Immediate value helpers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(decl imm (Type u64) Reg)