• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=x86 | FileCheck %s
2
3define i16 @foo(i16 %x, i16 %y, i16 %z) nounwind readnone {
4entry:
5; CHECK: foo:
6; CHECK: rolw %cl
7	%0 = shl i16 %x, %z
8	%1 = sub i16 16, %z
9	%2 = lshr i16 %x, %1
10	%3 = or i16 %2, %0
11	ret i16 %3
12}
13
14define i16 @bar(i16 %x, i16 %y, i16 %z) nounwind readnone {
15entry:
16; CHECK: bar:
17; CHECK: shldw %cl
18	%0 = shl i16 %y, %z
19	%1 = sub i16 16, %z
20	%2 = lshr i16 %x, %1
21	%3 = or i16 %2, %0
22	ret i16 %3
23}
24
25define i16 @un(i16 %x, i16 %y, i16 %z) nounwind readnone {
26entry:
27; CHECK: un:
28; CHECK: rorw %cl
29	%0 = lshr i16 %x, %z
30	%1 = sub i16 16, %z
31	%2 = shl i16 %x, %1
32	%3 = or i16 %2, %0
33	ret i16 %3
34}
35
36define i16 @bu(i16 %x, i16 %y, i16 %z) nounwind readnone {
37entry:
38; CHECK: bu:
39; CHECK: shrdw
40	%0 = lshr i16 %y, %z
41	%1 = sub i16 16, %z
42	%2 = shl i16 %x, %1
43	%3 = or i16 %2, %0
44	ret i16 %3
45}
46
47define i16 @xfoo(i16 %x, i16 %y, i16 %z) nounwind readnone {
48entry:
49; CHECK: xfoo:
50; CHECK: rolw $5
51	%0 = lshr i16 %x, 11
52	%1 = shl i16 %x, 5
53	%2 = or i16 %0, %1
54	ret i16 %2
55}
56
57define i16 @xbar(i16 %x, i16 %y, i16 %z) nounwind readnone {
58entry:
59; CHECK: xbar:
60; CHECK: shldw $5
61	%0 = shl i16 %y, 5
62	%1 = lshr i16 %x, 11
63	%2 = or i16 %0, %1
64	ret i16 %2
65}
66
67define i16 @xun(i16 %x, i16 %y, i16 %z) nounwind readnone {
68entry:
69; CHECK: xun:
70; CHECK: rolw $11
71	%0 = lshr i16 %x, 5
72	%1 = shl i16 %x, 11
73	%2 = or i16 %0, %1
74	ret i16 %2
75}
76
77define i16 @xbu(i16 %x, i16 %y, i16 %z) nounwind readnone {
78entry:
79; CHECK: xbu:
80; CHECK: shldw $11
81	%0 = lshr i16 %y, 5
82	%1 = shl i16 %x, 11
83	%2 = or i16 %0, %1
84	ret i16 %2
85}
86