blob: 14f92ca8694718c7e52b615f42d5472bce1ddcb7 [file] [log] [blame]
Akira Hatanakad6bc5232011-12-05 21:26:34 +00001; RUN: llc < %s -march=mips64el -mcpu=mips64r2 -mattr=n64 | FileCheck %s
2
3define i64 @dext(i64 %i) nounwind readnone {
4entry:
5; CHECK: dext ${{[0-9]+}}, ${{[0-9]+}}, 5, 10
6 %shr = lshr i64 %i, 5
7 %and = and i64 %shr, 1023
8 ret i64 %and
9}
10
11define i64 @dextm(i64 %i) nounwind readnone {
12entry:
13; CHECK: dext ${{[0-9]+}}, ${{[0-9]+}}, 5, 34
14 %shr = lshr i64 %i, 5
15 %and = and i64 %shr, 17179869183
16 ret i64 %and
17}
18
19define i64 @dextu(i64 %i) nounwind readnone {
20entry:
21; CHECK: dext ${{[0-9]+}}, ${{[0-9]+}}, 34, 6
22 %shr = lshr i64 %i, 34
23 %and = and i64 %shr, 63
24 ret i64 %and
25}
26
27define i64 @dins(i64 %i, i64 %j) nounwind readnone {
28entry:
29; CHECK: dins ${{[0-9]+}}, ${{[0-9]+}}, 8, 10
30 %shl2 = shl i64 %j, 8
31 %and = and i64 %shl2, 261888
32 %and3 = and i64 %i, -261889
33 %or = or i64 %and3, %and
34 ret i64 %or
35}
36
37define i64 @dinsm(i64 %i, i64 %j) nounwind readnone {
38entry:
39; CHECK: dins ${{[0-9]+}}, ${{[0-9]+}}, 10, 33
40 %shl4 = shl i64 %j, 10
41 %and = and i64 %shl4, 8796093021184
42 %and5 = and i64 %i, -8796093021185
43 %or = or i64 %and5, %and
44 ret i64 %or
45}
46
47define i64 @dinsu(i64 %i, i64 %j) nounwind readnone {
48entry:
49; CHECK: dins ${{[0-9]+}}, ${{[0-9]+}}, 40, 13
50 %shl4 = shl i64 %j, 40
51 %and = and i64 %shl4, 9006099743113216
52 %and5 = and i64 %i, -9006099743113217
53 %or = or i64 %and5, %and
54 ret i64 %or
55}