Skip to content

Commit

Permalink
Move emit and emit_safepoint to prelude.isle
Browse files Browse the repository at this point in the history
Even though the implementation of emit and emit_safepoint may
be platform-specific, the interface ought to be common so that
other code in prelude.isle may safely call these constructors.

This patch moves the definition of emit (from all platforms)
and emit_safepoint (s390x only) to prelude.isle.  This required
adding an emit_safepoint implementation to aarch64 and x64 as
well - the latter is still a stub as special move mitosis
handling will be required.
  • Loading branch information
uweigand authored and alexcrichton committed Feb 2, 2022
1 parent f4855ac commit 7f59f34
Show file tree
Hide file tree
Showing 12 changed files with 825 additions and 788 deletions.
7 changes: 0 additions & 7 deletions cranelift/codegen/src/isa/aarch64/inst.isle
Original file line number Diff line number Diff line change
Expand Up @@ -1371,13 +1371,6 @@

;; Instruction creation helpers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Emit an instruction.
;;
;; This is low-level and side-effectful; it should only be used as an
;; implementation detail by helpers that preserve the SSA facade themselves.
(decl emit (MInst) Unit)
(extern constructor emit emit)

;; Helper for creating the zero register.
(decl zero_reg () Reg)
(extern constructor zero_reg zero_reg)
Expand Down
4 changes: 4 additions & 0 deletions cranelift/codegen/src/isa/aarch64/lower/isle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ where
self.emitted_insts.push((inst.clone(), false));
}

fn emit_safepoint(&mut self, inst: &MInst) -> Unit {
self.emitted_insts.push((inst.clone(), true));
}

fn cond_br_zero(&mut self, reg: Reg) -> CondBrKind {
CondBrKind::Zero(reg)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
src/clif.isle 9ea75a6f790b5c03
src/prelude.isle 51d2aef2566c1c96
src/isa/aarch64/inst.isle f946561093de4ff5
src/prelude.isle 2bfcafbef6b29358
src/isa/aarch64/inst.isle 944323ff7d6db098
src/isa/aarch64/lower.isle 2d2e1e076a0c8a23
Loading

0 comments on commit 7f59f34

Please sign in to comment.