1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch64 -mattr=+d < %s | FileCheck %s
7 ; CHECK-NEXT: move $a0, $zero
12 define i64 @imm7ff0000000000000() {
13 ; CHECK-LABEL: imm7ff0000000000000:
15 ; CHECK-NEXT: lu52i.d $a0, $zero, 2047
17 ret i64 9218868437227405312
20 define i64 @imm0000000000000fff() {
21 ; CHECK-LABEL: imm0000000000000fff:
23 ; CHECK-NEXT: ori $a0, $zero, 4095
28 define i64 @imm0007ffff00000800() {
29 ; CHECK-LABEL: imm0007ffff00000800:
31 ; CHECK-NEXT: ori $a0, $zero, 2048
32 ; CHECK-NEXT: lu32i.d $a0, 524287
34 ret i64 2251795518720000
37 define i64 @immfff0000000000fff() {
38 ; CHECK-LABEL: immfff0000000000fff:
40 ; CHECK-NEXT: ori $a0, $zero, 4095
41 ; CHECK-NEXT: lu52i.d $a0, $a0, -1
43 ret i64 -4503599627366401
46 define i64 @imm0008000000000fff() {
47 ; CHECK-LABEL: imm0008000000000fff:
49 ; CHECK-NEXT: ori $a0, $zero, 4095
50 ; CHECK-NEXT: lu32i.d $a0, -524288
51 ; CHECK-NEXT: lu52i.d $a0, $a0, 0
53 ret i64 2251799813689343
56 define i64 @immfffffffffffff800() {
57 ; CHECK-LABEL: immfffffffffffff800:
59 ; CHECK-NEXT: addi.w $a0, $zero, -2048
64 define i64 @imm00000000fffff800() {
65 ; CHECK-LABEL: imm00000000fffff800:
67 ; CHECK-NEXT: addi.w $a0, $zero, -2048
68 ; CHECK-NEXT: lu32i.d $a0, 0
73 define i64 @imm000ffffffffff800() {
74 ; CHECK-LABEL: imm000ffffffffff800:
76 ; CHECK-NEXT: addi.w $a0, $zero, -2048
77 ; CHECK-NEXT: lu52i.d $a0, $a0, 0
79 ret i64 4503599627368448
82 define i64 @imm00080000fffff800() {
83 ; CHECK-LABEL: imm00080000fffff800:
85 ; CHECK-NEXT: addi.w $a0, $zero, -2048
86 ; CHECK-NEXT: lu32i.d $a0, -524288
87 ; CHECK-NEXT: lu52i.d $a0, $a0, 0
89 ret i64 2251804108650496
92 define i64 @imm000000007ffff000() {
93 ; CHECK-LABEL: imm000000007ffff000:
95 ; CHECK-NEXT: lu12i.w $a0, 524287
100 define i64 @imm0000000080000000() {
101 ; CHECK-LABEL: imm0000000080000000:
103 ; CHECK-NEXT: lu12i.w $a0, -524288
104 ; CHECK-NEXT: lu32i.d $a0, 0
109 define i64 @imm000ffffffffff000() {
110 ; CHECK-LABEL: imm000ffffffffff000:
112 ; CHECK-NEXT: lu12i.w $a0, -1
113 ; CHECK-NEXT: lu52i.d $a0, $a0, 0
115 ret i64 4503599627366400
118 define i64 @imm7ff0000080000000() {
119 ; CHECK-LABEL: imm7ff0000080000000:
121 ; CHECK-NEXT: lu12i.w $a0, -524288
122 ; CHECK-NEXT: lu32i.d $a0, 0
123 ; CHECK-NEXT: lu52i.d $a0, $a0, 2047
125 ret i64 9218868439374888960
128 define i64 @immffffffff80000800() {
129 ; CHECK-LABEL: immffffffff80000800:
131 ; CHECK-NEXT: lu12i.w $a0, -524288
132 ; CHECK-NEXT: ori $a0, $a0, 2048
137 define i64 @immffffffff7ffff800() {
138 ; CHECK-LABEL: immffffffff7ffff800:
140 ; CHECK-NEXT: lu12i.w $a0, 524287
141 ; CHECK-NEXT: ori $a0, $a0, 2048
142 ; CHECK-NEXT: lu32i.d $a0, -1
147 define i64 @imm7fffffff800007ff() {
148 ; CHECK-LABEL: imm7fffffff800007ff:
150 ; CHECK-NEXT: lu12i.w $a0, -524288
151 ; CHECK-NEXT: ori $a0, $a0, 2047
152 ; CHECK-NEXT: lu52i.d $a0, $a0, 2047
154 ret i64 9223372034707294207
157 define i64 @imm0008000080000800() {
158 ; CHECK-LABEL: imm0008000080000800:
160 ; CHECK-NEXT: lu12i.w $a0, -524288
161 ; CHECK-NEXT: ori $a0, $a0, 2048
162 ; CHECK-NEXT: lu32i.d $a0, -524288
163 ; CHECK-NEXT: lu52i.d $a0, $a0, 0
165 ret i64 2251801961170944