forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283930 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
db0c8c6
commit 6f185f6
Showing
1 changed file
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py | ||
; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s | ||
|
||
define i8 @select_i8_neg1_or_0(i1 %a) { | ||
; CHECK-LABEL: select_i8_neg1_or_0: | ||
; CHECK: # BB#0: | ||
; CHECK-NEXT: shlb $7, %dil | ||
; CHECK-NEXT: sarb $7, %dil | ||
; CHECK-NEXT: movl %edi, %eax | ||
; CHECK-NEXT: retq | ||
; | ||
%b = sext i1 %a to i8 | ||
ret i8 %b | ||
} | ||
|
||
define i8 @select_i8_neg1_or_0_zeroext(i1 zeroext %a) { | ||
; CHECK-LABEL: select_i8_neg1_or_0_zeroext: | ||
; CHECK: # BB#0: | ||
; CHECK-NEXT: shlb $7, %dil | ||
; CHECK-NEXT: sarb $7, %dil | ||
; CHECK-NEXT: movl %edi, %eax | ||
; CHECK-NEXT: retq | ||
; | ||
%b = sext i1 %a to i8 | ||
ret i8 %b | ||
} | ||
|
||
define i16 @select_i16_neg1_or_0(i1 %a) { | ||
; CHECK-LABEL: select_i16_neg1_or_0: | ||
; CHECK: # BB#0: | ||
; CHECK-NEXT: shll $15, %edi | ||
; CHECK-NEXT: sarw $15, %di | ||
; CHECK-NEXT: movl %edi, %eax | ||
; CHECK-NEXT: retq | ||
; | ||
%b = sext i1 %a to i16 | ||
ret i16 %b | ||
} | ||
|
||
define i16 @select_i16_neg1_or_0_zeroext(i1 zeroext %a) { | ||
; CHECK-LABEL: select_i16_neg1_or_0_zeroext: | ||
; CHECK: # BB#0: | ||
; CHECK-NEXT: movzbl %dil, %eax | ||
; CHECK-NEXT: shll $15, %eax | ||
; CHECK-NEXT: sarw $15, %ax | ||
; CHECK-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill> | ||
; CHECK-NEXT: retq | ||
; | ||
%b = sext i1 %a to i16 | ||
ret i16 %b | ||
} | ||
|
||
define i32 @select_i32_neg1_or_0(i1 %a) { | ||
; CHECK-LABEL: select_i32_neg1_or_0: | ||
; CHECK: # BB#0: | ||
; CHECK-NEXT: shll $31, %edi | ||
; CHECK-NEXT: sarl $31, %edi | ||
; CHECK-NEXT: movl %edi, %eax | ||
; CHECK-NEXT: retq | ||
; | ||
%b = sext i1 %a to i32 | ||
ret i32 %b | ||
} | ||
|
||
define i32 @select_i32_neg1_or_0_zeroext(i1 zeroext %a) { | ||
; CHECK-LABEL: select_i32_neg1_or_0_zeroext: | ||
; CHECK: # BB#0: | ||
; CHECK-NEXT: movzbl %dil, %eax | ||
; CHECK-NEXT: shll $31, %eax | ||
; CHECK-NEXT: sarl $31, %eax | ||
; CHECK-NEXT: retq | ||
; | ||
%b = sext i1 %a to i32 | ||
ret i32 %b | ||
} | ||
|
||
define i64 @select_i64_neg1_or_0(i1 %a) { | ||
; CHECK-LABEL: select_i64_neg1_or_0: | ||
; CHECK: # BB#0: | ||
; CHECK-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def> | ||
; CHECK-NEXT: shlq $63, %rdi | ||
; CHECK-NEXT: sarq $63, %rdi | ||
; CHECK-NEXT: movq %rdi, %rax | ||
; CHECK-NEXT: retq | ||
; | ||
%b = sext i1 %a to i64 | ||
ret i64 %b | ||
} | ||
|
||
define i64 @select_i64_neg1_or_0_zeroext(i1 zeroext %a) { | ||
; CHECK-LABEL: select_i64_neg1_or_0_zeroext: | ||
; CHECK: # BB#0: | ||
; CHECK-NEXT: movzbl %dil, %eax | ||
; CHECK-NEXT: shlq $63, %rax | ||
; CHECK-NEXT: sarq $63, %rax | ||
; CHECK-NEXT: retq | ||
; | ||
%b = sext i1 %a to i64 | ||
ret i64 %b | ||
} | ||
|