forked from OSchip/llvm-project
169 lines
5.0 KiB
LLVM
169 lines
5.0 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL
|
|
|
|
define i8 @test_i8(i32 %a, i8 %f, i8 %t) {
|
|
; ALL-LABEL: test_i8:
|
|
; ALL: # BB#0: # %entry
|
|
; ALL-NEXT: xorl %eax, %eax
|
|
; ALL-NEXT: cmpl %eax, %edi
|
|
; ALL-NEXT: setg %al
|
|
; ALL-NEXT: testb $1, %al
|
|
; ALL-NEXT: jne .LBB0_2
|
|
; ALL-NEXT: # BB#1: # %cond.false
|
|
; ALL-NEXT: movl %edx, %esi
|
|
; ALL-NEXT: .LBB0_2: # %cond.end
|
|
; ALL-NEXT: movl %esi, %eax
|
|
; ALL-NEXT: retq
|
|
entry:
|
|
%cmp = icmp sgt i32 %a, 0
|
|
br i1 %cmp, label %cond.true, label %cond.false
|
|
|
|
cond.true: ; preds = %entry
|
|
br label %cond.end
|
|
|
|
cond.false: ; preds = %entry
|
|
br label %cond.end
|
|
|
|
cond.end: ; preds = %cond.false, %cond.true
|
|
%cond = phi i8 [ %f, %cond.true ], [ %t, %cond.false ]
|
|
ret i8 %cond
|
|
}
|
|
|
|
define i16 @test_i16(i32 %a, i16 %f, i16 %t) {
|
|
; ALL-LABEL: test_i16:
|
|
; ALL: # BB#0: # %entry
|
|
; ALL-NEXT: xorl %eax, %eax
|
|
; ALL-NEXT: cmpl %eax, %edi
|
|
; ALL-NEXT: setg %al
|
|
; ALL-NEXT: testb $1, %al
|
|
; ALL-NEXT: jne .LBB1_2
|
|
; ALL-NEXT: # BB#1: # %cond.false
|
|
; ALL-NEXT: movl %edx, %esi
|
|
; ALL-NEXT: .LBB1_2: # %cond.end
|
|
; ALL-NEXT: movl %esi, %eax
|
|
; ALL-NEXT: retq
|
|
entry:
|
|
%cmp = icmp sgt i32 %a, 0
|
|
br i1 %cmp, label %cond.true, label %cond.false
|
|
|
|
cond.true: ; preds = %entry
|
|
br label %cond.end
|
|
|
|
cond.false: ; preds = %entry
|
|
br label %cond.end
|
|
|
|
cond.end: ; preds = %cond.false, %cond.true
|
|
%cond = phi i16 [ %f, %cond.true ], [ %t, %cond.false ]
|
|
ret i16 %cond
|
|
}
|
|
|
|
define i32 @test_i32(i32 %a, i32 %f, i32 %t) {
|
|
; ALL-LABEL: test_i32:
|
|
; ALL: # BB#0: # %entry
|
|
; ALL-NEXT: xorl %eax, %eax
|
|
; ALL-NEXT: cmpl %eax, %edi
|
|
; ALL-NEXT: setg %al
|
|
; ALL-NEXT: testb $1, %al
|
|
; ALL-NEXT: jne .LBB2_2
|
|
; ALL-NEXT: # BB#1: # %cond.false
|
|
; ALL-NEXT: movl %edx, %esi
|
|
; ALL-NEXT: .LBB2_2: # %cond.end
|
|
; ALL-NEXT: movl %esi, %eax
|
|
; ALL-NEXT: retq
|
|
entry:
|
|
%cmp = icmp sgt i32 %a, 0
|
|
br i1 %cmp, label %cond.true, label %cond.false
|
|
|
|
cond.true: ; preds = %entry
|
|
br label %cond.end
|
|
|
|
cond.false: ; preds = %entry
|
|
br label %cond.end
|
|
|
|
cond.end: ; preds = %cond.false, %cond.true
|
|
%cond = phi i32 [ %f, %cond.true ], [ %t, %cond.false ]
|
|
ret i32 %cond
|
|
}
|
|
|
|
define i64 @test_i64(i32 %a, i64 %f, i64 %t) {
|
|
; ALL-LABEL: test_i64:
|
|
; ALL: # BB#0: # %entry
|
|
; ALL-NEXT: xorl %eax, %eax
|
|
; ALL-NEXT: cmpl %eax, %edi
|
|
; ALL-NEXT: setg %al
|
|
; ALL-NEXT: testb $1, %al
|
|
; ALL-NEXT: jne .LBB3_2
|
|
; ALL-NEXT: # BB#1: # %cond.false
|
|
; ALL-NEXT: movq %rdx, %rsi
|
|
; ALL-NEXT: .LBB3_2: # %cond.end
|
|
; ALL-NEXT: movq %rsi, %rax
|
|
; ALL-NEXT: retq
|
|
entry:
|
|
%cmp = icmp sgt i32 %a, 0
|
|
br i1 %cmp, label %cond.true, label %cond.false
|
|
|
|
cond.true: ; preds = %entry
|
|
br label %cond.end
|
|
|
|
cond.false: ; preds = %entry
|
|
br label %cond.end
|
|
|
|
cond.end: ; preds = %cond.false, %cond.true
|
|
%cond = phi i64 [ %f, %cond.true ], [ %t, %cond.false ]
|
|
ret i64 %cond
|
|
}
|
|
|
|
define float @test_float(i32 %a, float %f, float %t) {
|
|
; ALL-LABEL: test_float:
|
|
; ALL: # BB#0: # %entry
|
|
; ALL-NEXT: xorl %eax, %eax
|
|
; ALL-NEXT: cmpl %eax, %edi
|
|
; ALL-NEXT: setg %al
|
|
; ALL-NEXT: testb $1, %al
|
|
; ALL-NEXT: jne .LBB4_2
|
|
; ALL-NEXT: # BB#1: # %cond.false
|
|
; ALL-NEXT: movaps %xmm1, %xmm0
|
|
; ALL-NEXT: .LBB4_2: # %cond.end
|
|
; ALL-NEXT: retq
|
|
entry:
|
|
%cmp = icmp sgt i32 %a, 0
|
|
br i1 %cmp, label %cond.true, label %cond.false
|
|
|
|
cond.true: ; preds = %entry
|
|
br label %cond.end
|
|
|
|
cond.false: ; preds = %entry
|
|
br label %cond.end
|
|
|
|
cond.end: ; preds = %cond.false, %cond.true
|
|
%cond = phi float [ %f, %cond.true ], [ %t, %cond.false ]
|
|
ret float %cond
|
|
}
|
|
|
|
define double @test_double(i32 %a, double %f, double %t) {
|
|
; ALL-LABEL: test_double:
|
|
; ALL: # BB#0: # %entry
|
|
; ALL-NEXT: xorl %eax, %eax
|
|
; ALL-NEXT: cmpl %eax, %edi
|
|
; ALL-NEXT: setg %al
|
|
; ALL-NEXT: testb $1, %al
|
|
; ALL-NEXT: jne .LBB5_2
|
|
; ALL-NEXT: # BB#1: # %cond.false
|
|
; ALL-NEXT: movaps %xmm1, %xmm0
|
|
; ALL-NEXT: .LBB5_2: # %cond.end
|
|
; ALL-NEXT: retq
|
|
entry:
|
|
%cmp = icmp sgt i32 %a, 0
|
|
br i1 %cmp, label %cond.true, label %cond.false
|
|
|
|
cond.true: ; preds = %entry
|
|
br label %cond.end
|
|
|
|
cond.false: ; preds = %entry
|
|
br label %cond.end
|
|
|
|
cond.end: ; preds = %cond.false, %cond.true
|
|
%cond = phi double [ %f, %cond.true ], [ %t, %cond.false ]
|
|
ret double %cond
|
|
}
|