Initial reftype support in aarch64, modulo safepoints.
This commit adds the inital support to allow reftypes to flow through the program when targetting aarch64. It also adds a fix to the `ModuleTranslationState` needed to send R32/R64 types over from the SpiderMonkey embedding. This commit does not include any support for safepoints in aarch64 or the `MachInst` infrastructure; that is in the next commit. This commit also makes a drive-by improvement to `Bint`, avoiding an unneeded zero-extension op when the extended value comes directly from a conditional-set (which produces a full-width 0 or 1).
This commit is contained in:
65
cranelift/filetests/filetests/vcode/aarch64/reftypes.clif
Normal file
65
cranelift/filetests/filetests/vcode/aarch64/reftypes.clif
Normal file
@@ -0,0 +1,65 @@
|
||||
test compile
|
||||
target aarch64
|
||||
|
||||
function %f0(r64) -> r64 {
|
||||
block0(v0: r64):
|
||||
return v0
|
||||
}
|
||||
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
; nextln: ret
|
||||
|
||||
function %f1(r32) -> r32 {
|
||||
block0(v0: r32):
|
||||
return v0
|
||||
}
|
||||
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
; nextln: ret
|
||||
|
||||
function %f2(r64) -> b1 {
|
||||
block0(v0: r64):
|
||||
v1 = is_null v0
|
||||
return v1
|
||||
}
|
||||
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: subs xzr, x0, #0
|
||||
; nextln: cset x0, eq
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
; nextln: ret
|
||||
|
||||
function %f3(r64) -> b1 {
|
||||
block0(v0: r64):
|
||||
v1 = is_invalid v0
|
||||
return v1
|
||||
}
|
||||
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: adds xzr, x0, #1
|
||||
; nextln: cset x0, eq
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
; nextln: ret
|
||||
|
||||
function %f4() -> r64 {
|
||||
block0:
|
||||
v0 = null.r64
|
||||
return v0
|
||||
}
|
||||
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: movz x0, #0
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
; nextln: ret
|
||||
Reference in New Issue
Block a user