1 ; RUN: llc -march=mips64 -mcpu=mips64r2 -target-abi=n64 < %s -o - | FileCheck %s
3 define i64 @dext_add_zext(i32 signext %n) {
6 %res = zext i32 %add to i64
9 ; CHECK-LABEL: dext_add_zext:
10 ; CHECK: dext $[[R0:[0-9]+]], $[[R0:[0-9]+]], 0, 32
14 define i32 @ext_and24(i32 signext %a) {
16 %and = and i32 %a, 16777215
19 ; CHECK-LABEL: ext_and24:
20 ; CHECK: ext $[[R0:[0-9]+]], $[[R1:[0-9]+]], 0, 24
24 define i64 @dext_and32(i64 zeroext %a) {
26 %and = and i64 %a, 4294967295
29 ; CHECK-LABEL: dext_and32:
30 ; CHECK: dext $[[R0:[0-9]+]], $[[R1:[0-9]+]], 0, 32
34 define i64 @dext_and35(i64 zeroext %a) {
36 %and = and i64 %a, 34359738367
39 ; CHECK-LABEL: dext_and35:
40 ; CHECK: dextm $[[R0:[0-9]+]], $[[R1:[0-9]+]], 0, 35
44 define i64 @dext_and20(i64 zeroext %a) {
46 %and = and i64 %a, 1048575
49 ; CHECK-LABEL: dext_and20:
50 ; CHECK: dext $[[R0:[0-9]+]], $[[R1:[0-9]+]], 0, 20
54 define i64 @dext_and16(i64 zeroext %a) {
56 %and = and i64 %a, 65535
59 ; CHECK-LABEL: dext_and16:
60 ; CHECK: andi $[[R0:[0-9]+]], $[[R1:[0-9]+]], 65535
64 define i64 @dext_lsr_and20(i64 zeroext %a) {
67 %and = and i64 %shr, 1048575
70 ; CHECK-LABEL: dext_lsr_and20:
71 ; CHECK: dext $[[R0:[0-9]+]], $[[R1:[0-9]+]], 5, 20
75 define i64 @dext_lsr_and8(i64 zeroext %a) {
77 %shr = lshr i64 %a, 40
78 %and = and i64 %shr, 255
81 ; CHECK-LABEL: dext_lsr_and8:
82 ; CHECK: dextu $[[R0:[0-9]+]], $[[R1:[0-9]+]], 40, 8
86 define i64 @dext_zext(i32 signext %a) {
88 %conv = zext i32 %a to i64
91 ; CHECK-LABEL: dext_zext:
92 ; CHECK: dext $[[R0:[0-9]+]], $[[R1:[0-9]+]], 0, 32
96 define i64 @dext_and_lsr(i64 zeroext %n) {
99 %shr = and i64 %and, 4095
102 ; CHECK-LABEL: dext_and_lsr:
103 ; CHECK: dext $[[R0:[0-9]+]], $[[R1:[0-9]+]], 8, 12