[Codegen] Adjust saturation test. NFC.
[llvm-core.git] / test / CodeGen / X86 / pr37820.ll
blob1eff33946825c8ce655ad2174cc1d8cfd34e3885
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu %s -o - | FileCheck %s
4 @a = external dso_local local_unnamed_addr global i64, align 8
5 @c = external dso_local local_unnamed_addr global i64, align 8
6 @b = external dso_local local_unnamed_addr global i64, align 8
8 ; Should generate a 16-bit load
10 define void @foo() {
11 ; CHECK-LABEL: foo:
12 ; CHECK:       # %bb.0: # %entry
13 ; CHECK-NEXT:    movzwl a+{{.*}}(%rip), %eax
14 ; CHECK-NEXT:    movq %rax, {{.*}}(%rip)
15 ; CHECK-NEXT:    retq
16 entry:
17   %0 = load i64, i64* @a, align 8
18   %1 = load i64, i64* @c, align 8
19   %and = and i64 %1, -16384
20   %add = add nsw i64 %and, 4503359447364223024
21   %shr = lshr i64 %0, %add
22   %conv1 = and i64 %shr, 4294967295
23   store i64 %conv1, i64* @b, align 8
24   ret void