[X86] Update test/CodeGen/X86/avg.ll with the help of update_llc_test_checks.py....
[oota-llvm.git] / test / CodeGen / X86 / h-registers-1.ll
1 ; RUN: llc -mattr=-bmi < %s -mtriple=x86_64-linux | FileCheck %s
2 ; RUN: llc -mattr=-bmi < %s -mtriple=x86_64-linux-gnux32 | FileCheck %s
3
4 ; LLVM creates virtual registers for values live across blocks
5 ; based on the type of the value. Make sure that the extracts
6 ; here use the GR64_NOREX register class for their result,
7 ; instead of plain GR64.
8
9 ; CHECK: foo:
10 ; CHECK: movzbl %{{[abcd]}}h, %e
11 ; CHECK: movzbl %{{[abcd]}}h, %e
12 ; CHECK: movzbl %{{[abcd]}}h, %e
13 ; CHECK: movzbl %{{[abcd]}}h, %e
14 ; CHECK: movzbl %{{[abcd]}}h, %e
15 ; CHECK: movzbl %{{[abcd]}}h, %e
16 ; CHECK: movzbl %{{[abcd]}}h, %e
17 ; CHECK: movzbl %{{[abcd]}}h, %e
18 ; CHECK: ret
19
20 define i64 @foo(i64 %a, i64 %b, i64 %c, i64 %d,
21                 i64 %e, i64 %f, i64 %g, i64 %h) {
22   %sa = lshr i64 %a, 8
23   %A = and i64 %sa, 255
24   %sb = lshr i64 %b, 8
25   %B = and i64 %sb, 255
26   %sc = lshr i64 %c, 8
27   %C = and i64 %sc, 255
28   %sd = lshr i64 %d, 8
29   %D = and i64 %sd, 255
30   %se = lshr i64 %e, 8
31   %E = and i64 %se, 255
32   %sf = lshr i64 %f, 8
33   %F = and i64 %sf, 255
34   %sg = lshr i64 %g, 8
35   %G = and i64 %sg, 255
36   %sh = lshr i64 %h, 8
37   %H = and i64 %sh, 255
38   br label %next
39
40 next:
41   %u = add i64 %A, %B
42   %v = add i64 %C, %D
43   %w = add i64 %E, %F
44   %x = add i64 %G, %H
45   %y = add i64 %u, %v
46   %z = add i64 %w, %x
47   %t = add i64 %y, %z
48   ret i64 %t
49 }