1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/CodeGen/X86/field-extract-use-trunc.ll
Dávid Bolvanský abfb9e7ee2 [Codegen][X86] Modernize/regenerate old tests. NFCI.
Summary:
Switch to FileCheck where possible.
Adjust tests so they can be easily regenerated by update scripts.

Reviewers: craig.topper, spatel, RKSimon

Reviewed By: spatel

Subscribers: MatzeB, qcolombet, arphaman, jfb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71211
2019-12-10 00:27:46 +01:00

109 lines
2.7 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i686-- | FileCheck %s --check-prefix=i686
; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s --check-prefix=x86_64
define i32 @test(i32 %f12) nounwind {
; i686-LABEL: test:
; i686: # %bb.0:
; i686-NEXT: movsbl {{[0-9]+}}(%esp), %eax
; i686-NEXT: retl
;
; x86_64-LABEL: test:
; x86_64: # %bb.0:
; x86_64-NEXT: shrl $16, %edi
; x86_64-NEXT: movsbl %dil, %eax
; x86_64-NEXT: retq
%tmp7.25 = lshr i32 %f12, 16
%tmp7.26 = trunc i32 %tmp7.25 to i8
%tmp78.2 = sext i8 %tmp7.26 to i32
ret i32 %tmp78.2
}
define i32 @test2(i32 %f12) nounwind {
; i686-LABEL: test2:
; i686: # %bb.0:
; i686-NEXT: movsbl {{[0-9]+}}(%esp), %eax
; i686-NEXT: retl
;
; x86_64-LABEL: test2:
; x86_64: # %bb.0:
; x86_64-NEXT: shrl $16, %edi
; x86_64-NEXT: movsbl %dil, %eax
; x86_64-NEXT: retq
%f11 = shl i32 %f12, 8
%tmp7.25 = ashr i32 %f11, 24
ret i32 %tmp7.25
}
define i32 @test3(i32 %f12) nounwind {
; i686-LABEL: test3:
; i686: # %bb.0:
; i686-NEXT: movl {{[0-9]+}}(%esp), %eax
; i686-NEXT: shrl $11, %eax
; i686-NEXT: movsbl %al, %eax
; i686-NEXT: retl
;
; x86_64-LABEL: test3:
; x86_64: # %bb.0:
; x86_64-NEXT: shrl $11, %edi
; x86_64-NEXT: movsbl %dil, %eax
; x86_64-NEXT: retq
%f11 = shl i32 %f12, 13
%tmp7.25 = ashr i32 %f11, 24
ret i32 %tmp7.25
}
define i64 @test4(i64 %f12) nounwind {
; i686-LABEL: test4:
; i686: # %bb.0:
; i686-NEXT: movl {{[0-9]+}}(%esp), %eax
; i686-NEXT: movl %eax, %edx
; i686-NEXT: sarl $31, %edx
; i686-NEXT: retl
;
; x86_64-LABEL: test4:
; x86_64: # %bb.0:
; x86_64-NEXT: movslq %edi, %rax
; x86_64-NEXT: retq
%f11 = shl i64 %f12, 32
%tmp7.25 = ashr i64 %f11, 32
ret i64 %tmp7.25
}
define i16 @test5(i16 %f12) nounwind {
; i686-LABEL: test5:
; i686: # %bb.0:
; i686-NEXT: movl {{[0-9]+}}(%esp), %eax
; i686-NEXT: shrl $6, %eax
; i686-NEXT: movsbl %al, %eax
; i686-NEXT: # kill: def $ax killed $ax killed $eax
; i686-NEXT: retl
;
; x86_64-LABEL: test5:
; x86_64: # %bb.0:
; x86_64-NEXT: shrl $6, %edi
; x86_64-NEXT: movsbl %dil, %eax
; x86_64-NEXT: # kill: def $ax killed $ax killed $eax
; x86_64-NEXT: retq
%f11 = shl i16 %f12, 2
%tmp7.25 = ashr i16 %f11, 8
ret i16 %tmp7.25
}
define i16 @test6(i16 %f12) nounwind {
; i686-LABEL: test6:
; i686: # %bb.0:
; i686-NEXT: movsbl {{[0-9]+}}(%esp), %eax
; i686-NEXT: # kill: def $ax killed $ax killed $eax
; i686-NEXT: retl
;
; x86_64-LABEL: test6:
; x86_64: # %bb.0:
; x86_64-NEXT: movsbl %dil, %eax
; x86_64-NEXT: # kill: def $ax killed $ax killed $eax
; x86_64-NEXT: retq
%f11 = shl i16 %f12, 8
%tmp7.25 = ashr i16 %f11, 8
ret i16 %tmp7.25
}