Files
wasmtime/cranelift/filetests/isa/intel/legalize-custom.cton
Jakob Stoklund Olesen 2201e6249e Add Intel encodings for brz.b1 and brnz.b1.
Use these encodings to test trapz.b1 and trapnz.b1.

When a b1 value is stored in a register, only the low 8 bits are valid.
This is so we can use the various setCC instructions to generate the b1
registers.
2017-08-28 14:56:11 -07:00

55 lines
954 B
Plaintext

; Test the custom legalizations.
test legalizer
isa intel
set is_64bit
isa intel
; regex: V=v\d+
; regex: EBB=ebb\d+
function %cond_trap(i32) {
ebb0(v1: i32):
trapz v1
return
; check: $ebb0($v1: i32):
; nextln: brnz $v1, $(new=$EBB)
; nextln: trap
; check: $new:
; nextln: return
}
function %cond_trap2(i32) {
ebb0(v1: i32):
trapnz v1
return
; check: $ebb0($v1: i32):
; nextln: brz $v1, $(new=$EBB)
; nextln: trap
; check: $new:
; nextln: return
}
function %cond_trap_b1(i32) {
ebb0(v1: i32):
v2 = icmp_imm eq v1, 6
trapz v2
return
; check: $ebb0($v1: i32):
; check: brnz $v2, $(new=$EBB)
; nextln: trap
; check: $new:
; nextln: return
}
function %cond_trap2_b1(i32) {
ebb0(v1: i32):
v2 = icmp_imm eq v1, 6
trapnz v2
return
; check: $ebb0($v1: i32):
; check: brz $v2, $(new=$EBB)
; nextln: trap
; check: $new:
; nextln: return
}