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.
This commit is contained in:
Jakob Stoklund Olesen
2017-08-28 14:54:35 -07:00
parent 217434b474
commit 2201e6249e
3 changed files with 52 additions and 0 deletions

View File

@@ -28,3 +28,27 @@ ebb0(v1: i32):
; 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
}