blob: f160603c2507ed923db2742236cdadab70ae2988 [file] [log] [blame]
Daniel Sandersde393322016-06-23 12:42:53 +00001; RUN: llc < %s -march=mips64el -mcpu=mips64r2 -target-abi=n64 | FileCheck %s
Akira Hatanaka20cee2e2011-12-05 21:26:34 +00002
3define i64 @dext(i64 %i) nounwind readnone {
4entry:
Daniel Sanders611eb822016-02-29 15:26:54 +00005; CHECK-LABEL: dext:
Akira Hatanaka20cee2e2011-12-05 21:26:34 +00006; CHECK: dext ${{[0-9]+}}, ${{[0-9]+}}, 5, 10
7 %shr = lshr i64 %i, 5
8 %and = and i64 %shr, 1023
9 ret i64 %and
10}
11
12define i64 @dextm(i64 %i) nounwind readnone {
13entry:
Daniel Sanders611eb822016-02-29 15:26:54 +000014; CHECK-LABEL: dextm:
15; CHECK: dextm ${{[0-9]+}}, ${{[0-9]+}}, 5, 34
Akira Hatanaka20cee2e2011-12-05 21:26:34 +000016 %shr = lshr i64 %i, 5
17 %and = and i64 %shr, 17179869183
18 ret i64 %and
19}
20
21define i64 @dextu(i64 %i) nounwind readnone {
22entry:
Daniel Sanders611eb822016-02-29 15:26:54 +000023; CHECK-LABEL: dextu:
24; CHECK: dextu ${{[0-9]+}}, ${{[0-9]+}}, 34, 6
Akira Hatanaka20cee2e2011-12-05 21:26:34 +000025 %shr = lshr i64 %i, 34
26 %and = and i64 %shr, 63
27 ret i64 %and
28}
29
30define i64 @dins(i64 %i, i64 %j) nounwind readnone {
31entry:
Daniel Sanders611eb822016-02-29 15:26:54 +000032; CHECK-LABEL: dins:
Akira Hatanaka20cee2e2011-12-05 21:26:34 +000033; CHECK: dins ${{[0-9]+}}, ${{[0-9]+}}, 8, 10
34 %shl2 = shl i64 %j, 8
35 %and = and i64 %shl2, 261888
36 %and3 = and i64 %i, -261889
37 %or = or i64 %and3, %and
38 ret i64 %or
39}
40
41define i64 @dinsm(i64 %i, i64 %j) nounwind readnone {
42entry:
Daniel Sanders611eb822016-02-29 15:26:54 +000043; CHECK-LABEL: dinsm:
Simon Dardis28365b32017-09-14 10:58:00 +000044; CHECK: dinsm ${{[0-9]+}}, ${{[0-9]+}}, 10, 33
Akira Hatanaka20cee2e2011-12-05 21:26:34 +000045 %shl4 = shl i64 %j, 10
46 %and = and i64 %shl4, 8796093021184
47 %and5 = and i64 %i, -8796093021185
48 %or = or i64 %and5, %and
49 ret i64 %or
50}
51
52define i64 @dinsu(i64 %i, i64 %j) nounwind readnone {
53entry:
Daniel Sanders611eb822016-02-29 15:26:54 +000054; CHECK-LABEL: dinsu:
Simon Dardis28365b32017-09-14 10:58:00 +000055; CHECK: dinsu ${{[0-9]+}}, ${{[0-9]+}}, 40, 13
Akira Hatanaka20cee2e2011-12-05 21:26:34 +000056 %shl4 = shl i64 %j, 40
57 %and = and i64 %shl4, 9006099743113216
58 %and5 = and i64 %i, -9006099743113217
59 %or = or i64 %and5, %and
60 ret i64 %or
61}