• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=i686-- | FileCheck %s --check-prefix=i686
3; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s --check-prefix=x86_64
4
5define i32 @test(i32 %f12) nounwind {
6; i686-LABEL: test:
7; i686:       # %bb.0:
8; i686-NEXT:    movsbl {{[0-9]+}}(%esp), %eax
9; i686-NEXT:    retl
10;
11; x86_64-LABEL: test:
12; x86_64:       # %bb.0:
13; x86_64-NEXT:    shrl $16, %edi
14; x86_64-NEXT:    movsbl %dil, %eax
15; x86_64-NEXT:    retq
16	%tmp7.25 = lshr i32 %f12, 16
17	%tmp7.26 = trunc i32 %tmp7.25 to i8
18	%tmp78.2 = sext i8 %tmp7.26 to i32
19	ret i32 %tmp78.2
20}
21
22define i32 @test2(i32 %f12) nounwind {
23; i686-LABEL: test2:
24; i686:       # %bb.0:
25; i686-NEXT:    movsbl {{[0-9]+}}(%esp), %eax
26; i686-NEXT:    retl
27;
28; x86_64-LABEL: test2:
29; x86_64:       # %bb.0:
30; x86_64-NEXT:    shrl $16, %edi
31; x86_64-NEXT:    movsbl %dil, %eax
32; x86_64-NEXT:    retq
33	%f11 = shl i32 %f12, 8
34	%tmp7.25 = ashr i32 %f11, 24
35	ret i32 %tmp7.25
36}
37
38define i32 @test3(i32 %f12) nounwind {
39; i686-LABEL: test3:
40; i686:       # %bb.0:
41; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
42; i686-NEXT:    shrl $11, %eax
43; i686-NEXT:    movsbl %al, %eax
44; i686-NEXT:    retl
45;
46; x86_64-LABEL: test3:
47; x86_64:       # %bb.0:
48; x86_64-NEXT:    shrl $11, %edi
49; x86_64-NEXT:    movsbl %dil, %eax
50; x86_64-NEXT:    retq
51	%f11 = shl i32 %f12, 13
52	%tmp7.25 = ashr i32 %f11, 24
53	ret i32 %tmp7.25
54}
55
56define i64 @test4(i64 %f12) nounwind {
57; i686-LABEL: test4:
58; i686:       # %bb.0:
59; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
60; i686-NEXT:    movl %eax, %edx
61; i686-NEXT:    sarl $31, %edx
62; i686-NEXT:    retl
63;
64; x86_64-LABEL: test4:
65; x86_64:       # %bb.0:
66; x86_64-NEXT:    movslq %edi, %rax
67; x86_64-NEXT:    retq
68	%f11 = shl i64 %f12, 32
69	%tmp7.25 = ashr i64 %f11, 32
70	ret i64 %tmp7.25
71}
72
73define i16 @test5(i16 %f12) nounwind {
74; i686-LABEL: test5:
75; i686:       # %bb.0:
76; i686-NEXT:    movl {{[0-9]+}}(%esp), %eax
77; i686-NEXT:    shrl $6, %eax
78; i686-NEXT:    movsbl %al, %eax
79; i686-NEXT:    # kill: def $ax killed $ax killed $eax
80; i686-NEXT:    retl
81;
82; x86_64-LABEL: test5:
83; x86_64:       # %bb.0:
84; x86_64-NEXT:    shrl $6, %edi
85; x86_64-NEXT:    movsbl %dil, %eax
86; x86_64-NEXT:    # kill: def $ax killed $ax killed $eax
87; x86_64-NEXT:    retq
88	%f11 = shl i16 %f12, 2
89	%tmp7.25 = ashr i16 %f11, 8
90	ret i16 %tmp7.25
91}
92
93define i16 @test6(i16 %f12) nounwind {
94; i686-LABEL: test6:
95; i686:       # %bb.0:
96; i686-NEXT:    movsbl {{[0-9]+}}(%esp), %eax
97; i686-NEXT:    # kill: def $ax killed $ax killed $eax
98; i686-NEXT:    retl
99;
100; x86_64-LABEL: test6:
101; x86_64:       # %bb.0:
102; x86_64-NEXT:    movsbl %dil, %eax
103; x86_64-NEXT:    # kill: def $ax killed $ax killed $eax
104; x86_64-NEXT:    retq
105	%f11 = shl i16 %f12, 8
106	%tmp7.25 = ashr i16 %f11, 8
107	ret i16 %tmp7.25
108}
109