2017-07-06 22:15:15 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
|
2012-08-19 01:53:03 +08:00
|
|
|
|
|
|
|
; rdar://12081007
|
|
|
|
|
|
|
|
define i32 @and_1(i8 zeroext %a, i8 zeroext %b, i32 %x) {
|
2017-07-06 22:15:15 +08:00
|
|
|
; CHECK-LABEL: and_1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-07-06 22:15:15 +08:00
|
|
|
; CHECK-NEXT: xorl %eax, %eax
|
2018-02-02 01:08:39 +08:00
|
|
|
; CHECK-NEXT: testb %dil, %sil
|
2017-07-06 22:15:15 +08:00
|
|
|
; CHECK-NEXT: cmovnel %edx, %eax
|
|
|
|
; CHECK-NEXT: retq
|
2012-08-19 01:53:03 +08:00
|
|
|
%1 = and i8 %b, %a
|
|
|
|
%2 = icmp ne i8 %1, 0
|
|
|
|
%3 = select i1 %2, i32 %x, i32 0
|
|
|
|
ret i32 %3
|
|
|
|
}
|
|
|
|
|
|
|
|
define zeroext i1 @and_2(i8 zeroext %a, i8 zeroext %b) {
|
2017-07-06 22:15:15 +08:00
|
|
|
; CHECK-LABEL: and_2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-02-02 01:08:39 +08:00
|
|
|
; CHECK-NEXT: testb %dil, %sil
|
2017-07-06 22:15:15 +08:00
|
|
|
; CHECK-NEXT: setne %al
|
|
|
|
; CHECK-NEXT: retq
|
2012-08-19 01:53:03 +08:00
|
|
|
%1 = and i8 %b, %a
|
|
|
|
%2 = icmp ne i8 %1, 0
|
|
|
|
ret i1 %2
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @xor_1(i8 zeroext %a, i8 zeroext %b, i32 %x) {
|
2017-07-06 22:15:15 +08:00
|
|
|
; CHECK-LABEL: xor_1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-07-06 22:15:15 +08:00
|
|
|
; CHECK-NEXT: xorl %eax, %eax
|
|
|
|
; CHECK-NEXT: xorb %dil, %sil
|
|
|
|
; CHECK-NEXT: cmovnel %edx, %eax
|
|
|
|
; CHECK-NEXT: retq
|
2012-08-19 01:53:03 +08:00
|
|
|
%1 = xor i8 %b, %a
|
|
|
|
%2 = icmp ne i8 %1, 0
|
|
|
|
%3 = select i1 %2, i32 %x, i32 0
|
|
|
|
ret i32 %3
|
|
|
|
}
|
|
|
|
|
|
|
|
define zeroext i1 @xor_2(i8 zeroext %a, i8 zeroext %b) {
|
2017-07-06 22:15:15 +08:00
|
|
|
; CHECK-LABEL: xor_2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-07-06 22:15:15 +08:00
|
|
|
; CHECK-NEXT: xorb %dil, %sil
|
|
|
|
; CHECK-NEXT: setne %al
|
|
|
|
; CHECK-NEXT: retq
|
2012-08-19 01:53:03 +08:00
|
|
|
%1 = xor i8 %b, %a
|
|
|
|
%2 = icmp ne i8 %1, 0
|
|
|
|
ret i1 %2
|
|
|
|
}
|
2017-07-06 22:15:15 +08:00
|
|
|
|