1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -o - %s | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 @global = external global i32
8 @global.1 = external global i64
10 define void @patatino() {
11 ; CHECK-LABEL: patatino:
12 ; CHECK: # %bb.0: # %bb
13 ; CHECK-NEXT: movl {{.*}}(%rip), %eax
14 ; CHECK-NEXT: movl %eax, %ecx
15 ; CHECK-NEXT: shrl $31, %ecx
16 ; CHECK-NEXT: addl $2147483647, %ecx # imm = 0x7FFFFFFF
17 ; CHECK-NEXT: shrl $31, %ecx
18 ; CHECK-NEXT: andl $-2, %ecx
19 ; CHECK-NEXT: andl $-536870912, %eax # imm = 0xE0000000
20 ; CHECK-NEXT: orl %ecx, %eax
21 ; CHECK-NEXT: movl %eax, {{.*}}(%rip)
24 %tmp = load i32, i32* @global
25 %tmp1 = lshr i32 %tmp, 31
26 %tmp2 = add nuw nsw i32 %tmp1, 2147483647
27 %tmp3 = load i64, i64* @global.1
28 %tmp4 = shl i64 %tmp3, 23
29 %tmp5 = add nsw i64 %tmp4, 8388639
30 %tmp6 = trunc i64 %tmp5 to i32
31 %tmp7 = lshr i32 %tmp2, %tmp6
32 %tmp8 = load i32, i32* @global
33 %tmp9 = and i32 %tmp7, 62
34 %tmp10 = and i32 %tmp8, -536870912
35 %tmp11 = or i32 %tmp9, %tmp10
36 store i32 %tmp11, i32* @global