1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
; Test whether the following functions, with vectors featuring negative or values larger than the element
; bit size have their results of operations generated correctly when placed into constant pools
; RUN: llc -march=mips64 -mattr=+msa,+fp64 -relocation-model=pic < %s \
; RUN: | FileCheck -check-prefixes=ALL,MIPS64 %s
; RUN: llc -march=mips -mattr=+msa,+fp64,+mips32r2 -relocation-model=pic < %s \
; RUN: | FileCheck -check-prefixes=ALL,MIPS32 %s
; RUN: llc -march=mips64el -mattr=+msa,+fp64 -relocation-model=pic < %s \
; RUN: | FileCheck -check-prefixes=ALL,MIPS64 %s
; RUN: llc -march=mipsel -mattr=+msa,+fp64,mips32r2 -relocation-model=pic < %s \
; RUN: | FileCheck -check-prefixes=ALL,MIPS32 %s
@llvm_mips_bclr_w_test_const_vec_res = global <4 x i32> zeroinitializer, align 16
define void @llvm_mips_bclr_w_test_const_vec() nounwind {
entry:
%0 = tail call <4 x i32> @llvm.mips.bclr.w(<4 x i32> <i32 2147483649, i32 2147483649, i32 7, i32 7>, <4 x i32> <i32 -1, i32 31, i32 2, i32 34>)
store <4 x i32> %0, <4 x i32>* @llvm_mips_bclr_w_test_const_vec_res
ret void
}
declare <4 x i32> @llvm.mips.bclr.w(<4 x i32>, <4 x i32>) nounwind
; MIPS32: [[LABEL:\$CPI[0-9]+_[0-9]+]]:
; MIPS64: [[LABEL:\.LCPI[0-9]+_[0-9]+]]:
; ALL: .4byte 1 # 0x1
; ALL: .4byte 1 # 0x1
; ALL: .4byte 3 # 0x3
; ALL: .4byte 3 # 0x3
; ALL-LABEL: llvm_mips_bclr_w_test_const_vec:
; MIPS32: lw $[[R2:[0-9]+]], %got([[LABEL]])($[[R1:[0-9]+]])
; MIPS32: addiu $[[R2]], $[[R2]], %lo([[LABEL]])
; MIPS32: lw $[[R3:[0-9]+]], %got(llvm_mips_bclr_w_test_const_vec_res)($[[R1]])
; MIPS64: ld $[[R2:[0-9]+]], %got_page([[LABEL]])($[[R1:[0-9]+]])
; MIPS64: daddiu $[[R2]], $[[R2]], %got_ofst([[LABEL]])
; MIPS64: ld $[[R3:[0-9]+]], %got_disp(llvm_mips_bclr_w_test_const_vec_res)($[[R1]])
; ALL: ld.w $w0, 0($[[R2]])
; ALL: st.w $w0, 0($[[R3]])
@llvm_mips_bneg_w_test_const_vec_res = global <4 x i32> zeroinitializer, align 16
define void @llvm_mips_bneg_w_test_const_vec() nounwind {
entry:
%0 = tail call <4 x i32> @llvm.mips.bneg.w(<4 x i32> <i32 2147483649, i32 2147483649, i32 7, i32 7>, <4 x i32> <i32 -1, i32 31, i32 2, i32 34>)
store <4 x i32> %0, <4 x i32>* @llvm_mips_bneg_w_test_const_vec_res
ret void
}
declare <4 x i32> @llvm.mips.bneg.w(<4 x i32>, <4 x i32>) nounwind
; MIPS32: [[LABEL:\$CPI[0-9]+_[0-9]+]]:
; MIPS64: [[LABEL:\.LCPI[0-9]+_[0-9]+]]:
; ALL: .4byte 1 # 0x1
; ALL: .4byte 1 # 0x1
; ALL: .4byte 3 # 0x3
; ALL: .4byte 3 # 0x3
; ALL-LABEL: llvm_mips_bneg_w_test_const_vec:
; MIPS32: lw $[[R2:[0-9]+]], %got([[LABEL]])($[[R1:[0-9]+]])
; MIPS32: addiu $[[R2]], $[[R2]], %lo([[LABEL]])
; MIPS32: lw $[[R3:[0-9]+]], %got(llvm_mips_bneg_w_test_const_vec_res)($[[R1]])
; MIPS64: ld $[[R2:[0-9]+]], %got_page([[LABEL]])($[[R1:[0-9]+]])
; MIPS64: daddiu $[[R2]], $[[R2]], %got_ofst([[LABEL]])
; MIPS64: ld $[[R3:[0-9]+]], %got_disp(llvm_mips_bneg_w_test_const_vec_res)($[[R1]])
; ALL: ld.w $w0, 0($[[R2]])
; ALL: st.w $w0, 0($[[R3]])
@llvm_mips_bset_w_test_const_vec_res = global <4 x i32> zeroinitializer, align 16
define void @llvm_mips_bset_w_test_const_vec() nounwind {
entry:
%0 = tail call <4 x i32> @llvm.mips.bset.w(<4 x i32> <i32 0, i32 0, i32 0, i32 0>, <4 x i32> <i32 -1, i32 31, i32 2, i32 34>)
store <4 x i32> %0, <4 x i32>* @llvm_mips_bset_w_test_const_vec_res
ret void
}
declare <4 x i32> @llvm.mips.bset.w(<4 x i32>, <4 x i32>) nounwind
; MIPS32: [[LABEL:\$CPI[0-9]+_[0-9]+]]:
; MIPS64: [[LABEL:\.LCPI[0-9]+_[0-9]+]]:
; ALL: .4byte 2147483648 # 0x80000000
; ALL: .4byte 2147483648 # 0x80000000
; ALL: .4byte 4 # 0x4
; ALL: .4byte 4 # 0x4
; ALL-LABEL: llvm_mips_bset_w_test_const_vec:
; MIPS32: lw $[[R2:[0-9]+]], %got([[LABEL]])($[[R1:[0-9]+]])
; MIPS32: addiu $[[R2]], $[[R2]], %lo([[LABEL]])
; MIPS32: lw $[[R3:[0-9]+]], %got(llvm_mips_bset_w_test_const_vec_res)($[[R1]])
; MIPS64: ld $[[R2:[0-9]+]], %got_page([[LABEL]])($[[R1:[0-9]+]])
; MIPS64: daddiu $[[R2]], $[[R2]], %got_ofst([[LABEL]])
; MIPS64: ld $[[R3:[0-9]+]], %got_disp(llvm_mips_bset_w_test_const_vec_res)($[[R1]])
; ALL: ld.w $w0, 0($[[R2]])
; ALL: st.w $w0, 0($[[R3]])
@llvm_mips_sll_w_test_const_vec_res = global <4 x i32> zeroinitializer, align 16
define void @llvm_mips_sll_w_test_const_vec() nounwind {
entry:
%0 = tail call <4 x i32> @llvm.mips.sll.w(<4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 -1, i32 31, i32 2, i32 34>)
store <4 x i32> %0, <4 x i32>* @llvm_mips_sll_w_test_const_vec_res
ret void
}
declare <4 x i32> @llvm.mips.sll.w(<4 x i32>, <4 x i32>) nounwind
; MIPS32: [[LABEL:\$CPI[0-9]+_[0-9]+]]:
; MIPS64: [[LABEL:\.LCPI[0-9]+_[0-9]+]]:
; ALL: .4byte 2147483648 # 0x80000000
; ALL: .4byte 2147483648 # 0x80000000
; ALL: .4byte 4 # 0x4
; ALL: .4byte 4 # 0x4
; ALL-LABEL: llvm_mips_sll_w_test_const_vec:
; MIPS32: lw $[[R2:[0-9]+]], %got([[LABEL]])($[[R1:[0-9]+]])
; MIPS32: addiu $[[R2]], $[[R2]], %lo([[LABEL]])
; MIPS32: lw $[[R3:[0-9]+]], %got(llvm_mips_sll_w_test_const_vec_res)($[[R1]])
; MIPS64: ld $[[R2:[0-9]+]], %got_page([[LABEL]])($[[R1:[0-9]+]])
; MIPS64: daddiu $[[R2]], $[[R2]], %got_ofst([[LABEL]])
; MIPS64: ld $[[R3:[0-9]+]], %got_disp(llvm_mips_sll_w_test_const_vec_res)($[[R1]])
; ALL: ld.w $w0, 0($[[R2]])
; ALL: st.w $w0, 0($[[R3]])
@llvm_mips_sra_w_test_const_vec_res = global <4 x i32> zeroinitializer, align 16
define void @llvm_mips_sra_w_test_const_vec() nounwind {
entry:
%0 = tail call <4 x i32> @llvm.mips.sra.w(<4 x i32> <i32 -16, i32 16, i32 16, i32 16>, <4 x i32> <i32 2, i32 -30, i32 33, i32 1>)
store <4 x i32> %0, <4 x i32>* @llvm_mips_sra_w_test_const_vec_res
ret void
}
declare <4 x i32> @llvm.mips.sra.w(<4 x i32>, <4 x i32>) nounwind
; MIPS32: [[LABEL:\$CPI[0-9]+_[0-9]+]]:
; MIPS64: [[LABEL:\.LCPI[0-9]+_[0-9]+]]:
; ALL: .4byte 4294967292 # 0xfffffffc
; ALL: .4byte 4 # 0x4
; ALL: .4byte 8 # 0x8
; ALL: .4byte 8 # 0x8
; ALL-LABEL: llvm_mips_sra_w_test_const_vec:
; MIPS32: lw $[[R2:[0-9]+]], %got([[LABEL]])($[[R1:[0-9]+]])
; MIPS32: addiu $[[R2]], $[[R2]], %lo([[LABEL]])
; MIPS32: lw $[[R3:[0-9]+]], %got(llvm_mips_sra_w_test_const_vec_res)($[[R1]])
; MIPS64: ld $[[R2:[0-9]+]], %got_page([[LABEL]])($[[R1:[0-9]+]])
; MIPS64: daddiu $[[R2]], $[[R2]], %got_ofst([[LABEL]])
; MIPS64: ld $[[R3:[0-9]+]], %got_disp(llvm_mips_sra_w_test_const_vec_res)($[[R1]])
; ALL: ld.w $w0, 0($[[R2]])
; ALL: st.w $w0, 0($[[R3]])
@llvm_mips_srl_w_test_const_vec_res = global <4 x i32> zeroinitializer, align 16
define void @llvm_mips_srl_w_test_const_vec() nounwind {
entry:
%0 = tail call <4 x i32> @llvm.mips.srl.w(<4 x i32> <i32 -16, i32 16, i32 16, i32 16>, <4 x i32> <i32 2, i32 -30, i32 33, i32 1>)
store <4 x i32> %0, <4 x i32>* @llvm_mips_srl_w_test_const_vec_res
ret void
}
declare <4 x i32> @llvm.mips.srl.w(<4 x i32>, <4 x i32>) nounwind
; MIPS32: [[LABEL:\$CPI[0-9]+_[0-9]+]]:
; MIPS64: [[LABEL:\.LCPI[0-9]+_[0-9]+]]:
; ALL: .4byte 1073741820 # 0x3ffffffc
; ALL: .4byte 4 # 0x4
; ALL: .4byte 8 # 0x8
; ALL: .4byte 8 # 0x8
; ALL-LABEL: llvm_mips_srl_w_test_const_vec:
; MIPS32: lw $[[R2:[0-9]+]], %got([[LABEL]])($[[R1:[0-9]+]])
; MIPS32: addiu $[[R2]], $[[R2]], %lo([[LABEL]])
; MIPS32: lw $[[R3:[0-9]+]], %got(llvm_mips_srl_w_test_const_vec_res)($[[R1]])
; MIPS64: ld $[[R2:[0-9]+]], %got_page([[LABEL]])($[[R1:[0-9]+]])
; MIPS64: daddiu $[[R2]], $[[R2]], %got_ofst([[LABEL]])
; MIPS64: ld $[[R3:[0-9]+]], %got_disp(llvm_mips_srl_w_test_const_vec_res)($[[R1]])
; ALL: ld.w $w0, 0($[[R2]])
; ALL: st.w $w0, 0($[[R3]])
|