llvm-project/llvm/test/CodeGen/X86/GlobalISel/trunc.ll

58 lines
1.3 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=x86_64-linux-gnu -global-isel < %s -o - | FileCheck %s --check-prefix=CHECK
define i1 @trunc_i32toi1(i32 %a) {
; CHECK-LABEL: trunc_i32toi1:
; CHECK: # BB#0:
; CHECK-NEXT: movl %edi, %eax
; CHECK-NEXT: retq
%r = trunc i32 %a to i1
ret i1 %r
}
define i8 @trunc_i32toi8(i32 %a) {
; CHECK-LABEL: trunc_i32toi8:
; CHECK: # BB#0:
; CHECK-NEXT: movl %edi, %eax
; CHECK-NEXT: retq
%r = trunc i32 %a to i8
ret i8 %r
}
define i16 @trunc_i32toi16(i32 %a) {
; CHECK-LABEL: trunc_i32toi16:
; CHECK: # BB#0:
; CHECK-NEXT: movl %edi, %eax
; CHECK-NEXT: retq
%r = trunc i32 %a to i16
ret i16 %r
}
define i8 @trunc_i64toi8(i64 %a) {
; CHECK-LABEL: trunc_i64toi8:
; CHECK: # BB#0:
; CHECK-NEXT: movl %edi, %eax
; CHECK-NEXT: retq
%r = trunc i64 %a to i8
ret i8 %r
}
define i16 @trunc_i64toi16(i64 %a) {
; CHECK-LABEL: trunc_i64toi16:
; CHECK: # BB#0:
; CHECK-NEXT: movl %edi, %eax
; CHECK-NEXT: retq
%r = trunc i64 %a to i16
ret i16 %r
}
define i32 @trunc_i64toi32(i64 %a) {
; CHECK-LABEL: trunc_i64toi32:
; CHECK: # BB#0:
; CHECK-NEXT: movl %edi, %eax
; CHECK-NEXT: retq
%r = trunc i64 %a to i32
ret i32 %r
}