Skip to content

Commit 5631b13

Browse files
committed
Add new tests for eq and unsigned checks
1 parent 28cef73 commit 5631b13

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

llvm/test/CodeGen/X86/cmp.ll

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,3 +1088,53 @@ define i1 @i40_sge(i40 %a) {
10881088
%v1 = icmp sge i64 %a64, -521
10891089
ret i1 %v1
10901090
}
1091+
1092+
define i1 @i40_eq(i40 %a) {
1093+
; NO-NDD-LABEL: i40_eq:
1094+
; NO-NDD: # %bb.0:
1095+
; NO-NDD-NEXT: movabsq $1099511627775, %rax # encoding: [0x48,0xb8,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00]
1096+
; NO-NDD-NEXT: # imm = 0xFFFFFFFFFF
1097+
; NO-NDD-NEXT: andq %rdi, %rax # encoding: [0x48,0x21,0xf8]
1098+
; NO-NDD-NEXT: movabsq $1099511627255, %rcx # encoding: [0x48,0xb9,0xf7,0xfd,0xff,0xff,0xff,0x00,0x00,0x00]
1099+
; NO-NDD-NEXT: # imm = 0xFFFFFFFDF7
1100+
; NO-NDD-NEXT: cmpq %rcx, %rax # encoding: [0x48,0x39,0xc8]
1101+
; NO-NDD-NEXT: sete %al # encoding: [0x0f,0x94,0xc0]
1102+
; NO-NDD-NEXT: retq # encoding: [0xc3]
1103+
;
1104+
; NDD-LABEL: i40_eq:
1105+
; NDD: # %bb.0:
1106+
; NDD-NEXT: movabsq $1099511627775, %rax # encoding: [0x48,0xb8,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00]
1107+
; NDD-NEXT: # imm = 0xFFFFFFFFFF
1108+
; NDD-NEXT: andq %rdi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x21,0xf8]
1109+
; NDD-NEXT: movabsq $1099511627255, %rcx # encoding: [0x48,0xb9,0xf7,0xfd,0xff,0xff,0xff,0x00,0x00,0x00]
1110+
; NDD-NEXT: # imm = 0xFFFFFFFDF7
1111+
; NDD-NEXT: cmpq %rcx, %rax # encoding: [0x48,0x39,0xc8]
1112+
; NDD-NEXT: sete %al # encoding: [0x0f,0x94,0xc0]
1113+
; NDD-NEXT: retq # encoding: [0xc3]
1114+
%a64 = sext i40 %a to i64
1115+
%v1 = icmp eq i64 %a64, -521
1116+
ret i1 %v1
1117+
}
1118+
1119+
define i1 @i40_ult(i40 %a) {
1120+
; NO-NDD-LABEL: i40_ult:
1121+
; NO-NDD: # %bb.0:
1122+
; NO-NDD-NEXT: shlq $24, %rdi # encoding: [0x48,0xc1,0xe7,0x18]
1123+
; NO-NDD-NEXT: sarq $24, %rdi # encoding: [0x48,0xc1,0xff,0x18]
1124+
; NO-NDD-NEXT: cmpq $-521, %rdi # encoding: [0x48,0x81,0xff,0xf7,0xfd,0xff,0xff]
1125+
; NO-NDD-NEXT: # imm = 0xFDF7
1126+
; NO-NDD-NEXT: setb %al # encoding: [0x0f,0x92,0xc0]
1127+
; NO-NDD-NEXT: retq # encoding: [0xc3]
1128+
;
1129+
; NDD-LABEL: i40_ult:
1130+
; NDD: # %bb.0:
1131+
; NDD-NEXT: shlq $24, %rdi # EVEX TO LEGACY Compression encoding: [0x48,0xc1,0xe7,0x18]
1132+
; NDD-NEXT: sarq $24, %rdi # EVEX TO LEGACY Compression encoding: [0x48,0xc1,0xff,0x18]
1133+
; NDD-NEXT: cmpq $-521, %rdi # encoding: [0x48,0x81,0xff,0xf7,0xfd,0xff,0xff]
1134+
; NDD-NEXT: # imm = 0xFDF7
1135+
; NDD-NEXT: setb %al # encoding: [0x0f,0x92,0xc0]
1136+
; NDD-NEXT: retq # encoding: [0xc3]
1137+
%a64 = sext i40 %a to i64
1138+
%v1 = icmp ult i64 %a64, -521
1139+
ret i1 %v1
1140+
}

0 commit comments

Comments
 (0)