1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-pc-linux-gnu -show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X86
3 ; RUN: llc < %s -mtriple=x86_64-pc-linux-gnu -show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X64
7 define i64 @bra(i32 %zed) nounwind {
10 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
11 ; X86-NEXT: andl $-64, %eax # encoding: [0x83,0xe0,0xc0]
12 ; X86-NEXT: xorl %edx, %edx # encoding: [0x31,0xd2]
13 ; X86-NEXT: retl # encoding: [0xc3]
17 ; X64-NEXT: movl %edi, %eax # encoding: [0x89,0xf8]
18 ; X64-NEXT: andl $-64, %eax # encoding: [0x83,0xe0,0xc0]
19 ; X64-NEXT: retq # encoding: [0xc3]
20 %t1 = zext i32 %zed to i64
21 %t2 = and i64 %t1, 4294967232
25 define void @foo(i64 %zed, i64* %x) nounwind {
28 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x0c]
29 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx # encoding: [0x8b,0x4c,0x24,0x04]
30 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx # encoding: [0x8b,0x54,0x24,0x08]
31 ; X86-NEXT: andl $-4, %ecx # encoding: [0x83,0xe1,0xfc]
32 ; X86-NEXT: orl $2, %ecx # encoding: [0x83,0xc9,0x02]
33 ; X86-NEXT: movl %edx, 4(%eax) # encoding: [0x89,0x50,0x04]
34 ; X86-NEXT: movl %ecx, (%eax) # encoding: [0x89,0x08]
35 ; X86-NEXT: retl # encoding: [0xc3]
39 ; X64-NEXT: andq $-4, %rdi # encoding: [0x48,0x83,0xe7,0xfc]
40 ; X64-NEXT: orq $2, %rdi # encoding: [0x48,0x83,0xcf,0x02]
41 ; X64-NEXT: movq %rdi, (%rsi) # encoding: [0x48,0x89,0x3e]
42 ; X64-NEXT: retq # encoding: [0xc3]
43 %t1 = and i64 %zed, -4
45 store i64 %t2, i64* %x, align 8
49 define i64 @bar(i64 %zed) nounwind {
52 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
53 ; X86-NEXT: andl $42, %eax # encoding: [0x83,0xe0,0x2a]
54 ; X86-NEXT: xorl %edx, %edx # encoding: [0x31,0xd2]
55 ; X86-NEXT: retl # encoding: [0xc3]
59 ; X64-NEXT: movq %rdi, %rax # encoding: [0x48,0x89,0xf8]
60 ; X64-NEXT: andl $42, %eax # encoding: [0x83,0xe0,0x2a]
61 ; X64-NEXT: retq # encoding: [0xc3]
62 %t1 = and i64 %zed, 42
66 define i64 @baz(i64 %zed) nounwind {
69 ; X86-NEXT: movl $2147483647, %eax # encoding: [0xb8,0xff,0xff,0xff,0x7f]
70 ; X86-NEXT: # imm = 0x7FFFFFFF
71 ; X86-NEXT: andl {{[0-9]+}}(%esp), %eax # encoding: [0x23,0x44,0x24,0x04]
72 ; X86-NEXT: xorl %edx, %edx # encoding: [0x31,0xd2]
73 ; X86-NEXT: retl # encoding: [0xc3]
77 ; X64-NEXT: movq %rdi, %rax # encoding: [0x48,0x89,0xf8]
78 ; X64-NEXT: andl $2147483647, %eax # encoding: [0x25,0xff,0xff,0xff,0x7f]
79 ; X64-NEXT: # imm = 0x7FFFFFFF
80 ; X64-NEXT: retq # encoding: [0xc3]
81 %t1 = and i64 %zed, 2147483647