diff options
author | Jack Carter <jack.carter@imgtec.com> | 2013-08-15 14:22:07 +0000 |
---|---|---|
committer | Jack Carter <jack.carter@imgtec.com> | 2013-08-15 14:22:07 +0000 |
commit | bd71eea899d579deb1fcee02944f955a4708091a (patch) | |
tree | be24275208d0486971942ed18ef0c487905cb497 /test/CodeGen/Mips/msa | |
parent | d0f99639c16ddad697db30e75643ae4cc52c3e80 (diff) | |
download | external_llvm-bd71eea899d579deb1fcee02944f955a4708091a.zip external_llvm-bd71eea899d579deb1fcee02944f955a4708091a.tar.gz external_llvm-bd71eea899d579deb1fcee02944f955a4708091a.tar.bz2 |
[Mips][msa] Added the simple builtins (madd_q to xori)
Includes:
madd_q, maddr_q, maddv, max_[asu], maxi_[su], min_[asu], mini_[su], mod_[su],
msub_q, msubr_q, msubv, mul_q, mulr_q, mulv, nloc, nlzc, nori, ori, pckev,
pckod, pcnt, sat_[su], shf, sld, sldi, sll, slli, splat, splati, sr[al],
sr[al]i, subs_[su], subss_u, subus_s, subv, subvi, vshf, xori
Patch by Daniel Sanders
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188460 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Mips/msa')
-rw-r--r-- | test/CodeGen/Mips/msa/2r.ll | 230 | ||||
-rw-r--r-- | test/CodeGen/Mips/msa/3r-m.ll | 794 | ||||
-rw-r--r-- | test/CodeGen/Mips/msa/3r-p.ll | 178 | ||||
-rw-r--r-- | test/CodeGen/Mips/msa/3r-s.ll | 794 | ||||
-rw-r--r-- | test/CodeGen/Mips/msa/3r-v.ll | 90 | ||||
-rw-r--r-- | test/CodeGen/Mips/msa/3r_4r.ll | 202 | ||||
-rw-r--r-- | test/CodeGen/Mips/msa/3r_splat.ll | 78 | ||||
-rw-r--r-- | test/CodeGen/Mips/msa/3rf_4rf_q.ll | 202 | ||||
-rw-r--r-- | test/CodeGen/Mips/msa/3rf_q.ll | 90 | ||||
-rw-r--r-- | test/CodeGen/Mips/msa/bit.ll | 382 | ||||
-rw-r--r-- | test/CodeGen/Mips/msa/elm_shift_slide.ll | 154 | ||||
-rw-r--r-- | test/CodeGen/Mips/msa/i5-m.ll | 306 | ||||
-rw-r--r-- | test/CodeGen/Mips/msa/i5-s.ll | 78 | ||||
-rw-r--r-- | test/CodeGen/Mips/msa/i8.ll | 114 |
14 files changed, 3692 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/msa/2r.ll b/test/CodeGen/Mips/msa/2r.ll new file mode 100644 index 0000000..b0061ae --- /dev/null +++ b/test/CodeGen/Mips/msa/2r.ll @@ -0,0 +1,230 @@ +; RUN: llc -march=mips -mattr=+msa < %s | FileCheck %s + +@llvm_mips_nloc_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_nloc_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_nloc_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_nloc_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.nloc.b(<16 x i8> %0) + store <16 x i8> %1, <16 x i8>* @llvm_mips_nloc_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.nloc.b(<16 x i8>) nounwind + +; CHECK: llvm_mips_nloc_b_test: +; CHECK: ld.b +; CHECK: nloc.b +; CHECK: st.b +; CHECK: .size llvm_mips_nloc_b_test +; +@llvm_mips_nloc_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_nloc_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_nloc_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_nloc_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.nloc.h(<8 x i16> %0) + store <8 x i16> %1, <8 x i16>* @llvm_mips_nloc_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.nloc.h(<8 x i16>) nounwind + +; CHECK: llvm_mips_nloc_h_test: +; CHECK: ld.h +; CHECK: nloc.h +; CHECK: st.h +; CHECK: .size llvm_mips_nloc_h_test +; +@llvm_mips_nloc_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_nloc_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_nloc_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_nloc_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.nloc.w(<4 x i32> %0) + store <4 x i32> %1, <4 x i32>* @llvm_mips_nloc_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.nloc.w(<4 x i32>) nounwind + +; CHECK: llvm_mips_nloc_w_test: +; CHECK: ld.w +; CHECK: nloc.w +; CHECK: st.w +; CHECK: .size llvm_mips_nloc_w_test +; +@llvm_mips_nloc_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_nloc_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_nloc_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_nloc_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.nloc.d(<2 x i64> %0) + store <2 x i64> %1, <2 x i64>* @llvm_mips_nloc_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.nloc.d(<2 x i64>) nounwind + +; CHECK: llvm_mips_nloc_d_test: +; CHECK: ld.d +; CHECK: nloc.d +; CHECK: st.d +; CHECK: .size llvm_mips_nloc_d_test +; +@llvm_mips_nlzc_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_nlzc_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_nlzc_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_nlzc_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.nlzc.b(<16 x i8> %0) + store <16 x i8> %1, <16 x i8>* @llvm_mips_nlzc_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.nlzc.b(<16 x i8>) nounwind + +; CHECK: llvm_mips_nlzc_b_test: +; CHECK: ld.b +; CHECK: nlzc.b +; CHECK: st.b +; CHECK: .size llvm_mips_nlzc_b_test +; +@llvm_mips_nlzc_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_nlzc_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_nlzc_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_nlzc_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.nlzc.h(<8 x i16> %0) + store <8 x i16> %1, <8 x i16>* @llvm_mips_nlzc_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.nlzc.h(<8 x i16>) nounwind + +; CHECK: llvm_mips_nlzc_h_test: +; CHECK: ld.h +; CHECK: nlzc.h +; CHECK: st.h +; CHECK: .size llvm_mips_nlzc_h_test +; +@llvm_mips_nlzc_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_nlzc_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_nlzc_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_nlzc_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.nlzc.w(<4 x i32> %0) + store <4 x i32> %1, <4 x i32>* @llvm_mips_nlzc_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.nlzc.w(<4 x i32>) nounwind + +; CHECK: llvm_mips_nlzc_w_test: +; CHECK: ld.w +; CHECK: nlzc.w +; CHECK: st.w +; CHECK: .size llvm_mips_nlzc_w_test +; +@llvm_mips_nlzc_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_nlzc_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_nlzc_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_nlzc_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.nlzc.d(<2 x i64> %0) + store <2 x i64> %1, <2 x i64>* @llvm_mips_nlzc_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.nlzc.d(<2 x i64>) nounwind + +; CHECK: llvm_mips_nlzc_d_test: +; CHECK: ld.d +; CHECK: nlzc.d +; CHECK: st.d +; CHECK: .size llvm_mips_nlzc_d_test +; +@llvm_mips_pcnt_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_pcnt_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_pcnt_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_pcnt_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.pcnt.b(<16 x i8> %0) + store <16 x i8> %1, <16 x i8>* @llvm_mips_pcnt_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.pcnt.b(<16 x i8>) nounwind + +; CHECK: llvm_mips_pcnt_b_test: +; CHECK: ld.b +; CHECK: pcnt.b +; CHECK: st.b +; CHECK: .size llvm_mips_pcnt_b_test +; +@llvm_mips_pcnt_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_pcnt_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_pcnt_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_pcnt_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.pcnt.h(<8 x i16> %0) + store <8 x i16> %1, <8 x i16>* @llvm_mips_pcnt_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.pcnt.h(<8 x i16>) nounwind + +; CHECK: llvm_mips_pcnt_h_test: +; CHECK: ld.h +; CHECK: pcnt.h +; CHECK: st.h +; CHECK: .size llvm_mips_pcnt_h_test +; +@llvm_mips_pcnt_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_pcnt_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_pcnt_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_pcnt_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.pcnt.w(<4 x i32> %0) + store <4 x i32> %1, <4 x i32>* @llvm_mips_pcnt_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.pcnt.w(<4 x i32>) nounwind + +; CHECK: llvm_mips_pcnt_w_test: +; CHECK: ld.w +; CHECK: pcnt.w +; CHECK: st.w +; CHECK: .size llvm_mips_pcnt_w_test +; +@llvm_mips_pcnt_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_pcnt_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_pcnt_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_pcnt_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.pcnt.d(<2 x i64> %0) + store <2 x i64> %1, <2 x i64>* @llvm_mips_pcnt_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.pcnt.d(<2 x i64>) nounwind + +; CHECK: llvm_mips_pcnt_d_test: +; CHECK: ld.d +; CHECK: pcnt.d +; CHECK: st.d +; CHECK: .size llvm_mips_pcnt_d_test +; diff --git a/test/CodeGen/Mips/msa/3r-m.ll b/test/CodeGen/Mips/msa/3r-m.ll new file mode 100644 index 0000000..7f0cb36 --- /dev/null +++ b/test/CodeGen/Mips/msa/3r-m.ll @@ -0,0 +1,794 @@ +; RUN: llc -march=mips -mattr=+msa < %s | FileCheck %s + +@llvm_mips_max_a_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_max_a_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_max_a_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_max_a_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_max_a_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_max_a_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.max.a.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_max_a_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.max.a.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_max_a_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: max_a.b +; CHECK: st.b +; CHECK: .size llvm_mips_max_a_b_test +; +@llvm_mips_max_a_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_max_a_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_max_a_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_max_a_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_max_a_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_max_a_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.max.a.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_max_a_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.max.a.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_max_a_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: max_a.h +; CHECK: st.h +; CHECK: .size llvm_mips_max_a_h_test +; +@llvm_mips_max_a_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_max_a_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_max_a_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_max_a_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_max_a_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_max_a_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.max.a.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_max_a_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.max.a.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_max_a_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: max_a.w +; CHECK: st.w +; CHECK: .size llvm_mips_max_a_w_test +; +@llvm_mips_max_a_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_max_a_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_max_a_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_max_a_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_max_a_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_max_a_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.max.a.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_max_a_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.max.a.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_max_a_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: max_a.d +; CHECK: st.d +; CHECK: .size llvm_mips_max_a_d_test +; +@llvm_mips_max_s_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_max_s_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_max_s_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_max_s_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_max_s_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_max_s_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.max.s.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_max_s_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.max.s.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_max_s_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: max_s.b +; CHECK: st.b +; CHECK: .size llvm_mips_max_s_b_test +; +@llvm_mips_max_s_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_max_s_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_max_s_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_max_s_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_max_s_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_max_s_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.max.s.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_max_s_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.max.s.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_max_s_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: max_s.h +; CHECK: st.h +; CHECK: .size llvm_mips_max_s_h_test +; +@llvm_mips_max_s_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_max_s_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_max_s_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_max_s_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_max_s_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_max_s_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.max.s.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_max_s_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.max.s.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_max_s_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: max_s.w +; CHECK: st.w +; CHECK: .size llvm_mips_max_s_w_test +; +@llvm_mips_max_s_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_max_s_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_max_s_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_max_s_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_max_s_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_max_s_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.max.s.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_max_s_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.max.s.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_max_s_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: max_s.d +; CHECK: st.d +; CHECK: .size llvm_mips_max_s_d_test +; +@llvm_mips_max_u_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_max_u_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_max_u_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_max_u_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_max_u_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_max_u_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.max.u.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_max_u_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.max.u.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_max_u_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: max_u.b +; CHECK: st.b +; CHECK: .size llvm_mips_max_u_b_test +; +@llvm_mips_max_u_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_max_u_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_max_u_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_max_u_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_max_u_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_max_u_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.max.u.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_max_u_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.max.u.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_max_u_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: max_u.h +; CHECK: st.h +; CHECK: .size llvm_mips_max_u_h_test +; +@llvm_mips_max_u_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_max_u_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_max_u_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_max_u_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_max_u_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_max_u_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.max.u.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_max_u_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.max.u.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_max_u_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: max_u.w +; CHECK: st.w +; CHECK: .size llvm_mips_max_u_w_test +; +@llvm_mips_max_u_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_max_u_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_max_u_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_max_u_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_max_u_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_max_u_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.max.u.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_max_u_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.max.u.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_max_u_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: max_u.d +; CHECK: st.d +; CHECK: .size llvm_mips_max_u_d_test +; +@llvm_mips_min_a_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_min_a_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_min_a_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_min_a_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_min_a_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_min_a_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.min.a.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_min_a_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.min.a.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_min_a_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: min_a.b +; CHECK: st.b +; CHECK: .size llvm_mips_min_a_b_test +; +@llvm_mips_min_a_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_min_a_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_min_a_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_min_a_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_min_a_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_min_a_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.min.a.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_min_a_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.min.a.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_min_a_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: min_a.h +; CHECK: st.h +; CHECK: .size llvm_mips_min_a_h_test +; +@llvm_mips_min_a_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_min_a_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_min_a_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_min_a_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_min_a_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_min_a_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.min.a.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_min_a_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.min.a.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_min_a_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: min_a.w +; CHECK: st.w +; CHECK: .size llvm_mips_min_a_w_test +; +@llvm_mips_min_a_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_min_a_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_min_a_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_min_a_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_min_a_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_min_a_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.min.a.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_min_a_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.min.a.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_min_a_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: min_a.d +; CHECK: st.d +; CHECK: .size llvm_mips_min_a_d_test +; +@llvm_mips_min_s_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_min_s_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_min_s_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_min_s_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_min_s_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_min_s_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.min.s.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_min_s_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.min.s.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_min_s_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: min_s.b +; CHECK: st.b +; CHECK: .size llvm_mips_min_s_b_test +; +@llvm_mips_min_s_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_min_s_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_min_s_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_min_s_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_min_s_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_min_s_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.min.s.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_min_s_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.min.s.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_min_s_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: min_s.h +; CHECK: st.h +; CHECK: .size llvm_mips_min_s_h_test +; +@llvm_mips_min_s_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_min_s_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_min_s_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_min_s_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_min_s_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_min_s_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.min.s.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_min_s_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.min.s.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_min_s_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: min_s.w +; CHECK: st.w +; CHECK: .size llvm_mips_min_s_w_test +; +@llvm_mips_min_s_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_min_s_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_min_s_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_min_s_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_min_s_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_min_s_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.min.s.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_min_s_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.min.s.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_min_s_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: min_s.d +; CHECK: st.d +; CHECK: .size llvm_mips_min_s_d_test +; +@llvm_mips_min_u_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_min_u_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_min_u_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_min_u_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_min_u_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_min_u_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.min.u.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_min_u_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.min.u.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_min_u_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: min_u.b +; CHECK: st.b +; CHECK: .size llvm_mips_min_u_b_test +; +@llvm_mips_min_u_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_min_u_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_min_u_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_min_u_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_min_u_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_min_u_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.min.u.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_min_u_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.min.u.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_min_u_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: min_u.h +; CHECK: st.h +; CHECK: .size llvm_mips_min_u_h_test +; +@llvm_mips_min_u_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_min_u_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_min_u_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_min_u_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_min_u_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_min_u_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.min.u.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_min_u_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.min.u.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_min_u_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: min_u.w +; CHECK: st.w +; CHECK: .size llvm_mips_min_u_w_test +; +@llvm_mips_min_u_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_min_u_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_min_u_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_min_u_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_min_u_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_min_u_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.min.u.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_min_u_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.min.u.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_min_u_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: min_u.d +; CHECK: st.d +; CHECK: .size llvm_mips_min_u_d_test +; +@llvm_mips_mod_s_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_mod_s_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_mod_s_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_mod_s_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_mod_s_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_mod_s_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.mod.s.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_mod_s_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.mod.s.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_mod_s_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: mod_s.b +; CHECK: st.b +; CHECK: .size llvm_mips_mod_s_b_test +; +@llvm_mips_mod_s_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_mod_s_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_mod_s_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_mod_s_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_mod_s_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_mod_s_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.mod.s.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_mod_s_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.mod.s.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_mod_s_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: mod_s.h +; CHECK: st.h +; CHECK: .size llvm_mips_mod_s_h_test +; +@llvm_mips_mod_s_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_mod_s_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_mod_s_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_mod_s_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_mod_s_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_mod_s_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.mod.s.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_mod_s_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.mod.s.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_mod_s_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: mod_s.w +; CHECK: st.w +; CHECK: .size llvm_mips_mod_s_w_test +; +@llvm_mips_mod_s_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_mod_s_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_mod_s_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_mod_s_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_mod_s_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_mod_s_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.mod.s.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_mod_s_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.mod.s.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_mod_s_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: mod_s.d +; CHECK: st.d +; CHECK: .size llvm_mips_mod_s_d_test +; +@llvm_mips_mod_u_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_mod_u_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_mod_u_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_mod_u_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_mod_u_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_mod_u_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.mod.u.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_mod_u_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.mod.u.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_mod_u_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: mod_u.b +; CHECK: st.b +; CHECK: .size llvm_mips_mod_u_b_test +; +@llvm_mips_mod_u_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_mod_u_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_mod_u_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_mod_u_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_mod_u_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_mod_u_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.mod.u.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_mod_u_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.mod.u.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_mod_u_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: mod_u.h +; CHECK: st.h +; CHECK: .size llvm_mips_mod_u_h_test +; +@llvm_mips_mod_u_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_mod_u_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_mod_u_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_mod_u_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_mod_u_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_mod_u_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.mod.u.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_mod_u_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.mod.u.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_mod_u_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: mod_u.w +; CHECK: st.w +; CHECK: .size llvm_mips_mod_u_w_test +; +@llvm_mips_mod_u_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_mod_u_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_mod_u_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_mod_u_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_mod_u_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_mod_u_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.mod.u.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_mod_u_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.mod.u.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_mod_u_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: mod_u.d +; CHECK: st.d +; CHECK: .size llvm_mips_mod_u_d_test +; +@llvm_mips_mulv_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_mulv_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_mulv_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_mulv_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_mulv_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_mulv_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.mulv.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_mulv_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.mulv.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_mulv_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: mulv.b +; CHECK: st.b +; CHECK: .size llvm_mips_mulv_b_test +; +@llvm_mips_mulv_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_mulv_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_mulv_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_mulv_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_mulv_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_mulv_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.mulv.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_mulv_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.mulv.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_mulv_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: mulv.h +; CHECK: st.h +; CHECK: .size llvm_mips_mulv_h_test +; +@llvm_mips_mulv_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_mulv_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_mulv_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_mulv_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_mulv_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_mulv_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.mulv.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_mulv_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.mulv.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_mulv_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: mulv.w +; CHECK: st.w +; CHECK: .size llvm_mips_mulv_w_test +; +@llvm_mips_mulv_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_mulv_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_mulv_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_mulv_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_mulv_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_mulv_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.mulv.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_mulv_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.mulv.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_mulv_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: mulv.d +; CHECK: st.d +; CHECK: .size llvm_mips_mulv_d_test +; diff --git a/test/CodeGen/Mips/msa/3r-p.ll b/test/CodeGen/Mips/msa/3r-p.ll new file mode 100644 index 0000000..1386533 --- /dev/null +++ b/test/CodeGen/Mips/msa/3r-p.ll @@ -0,0 +1,178 @@ +; RUN: llc -march=mips -mattr=+msa < %s | FileCheck %s + +@llvm_mips_pckev_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_pckev_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_pckev_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_pckev_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_pckev_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_pckev_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.pckev.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_pckev_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.pckev.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_pckev_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: pckev.b +; CHECK: st.b +; CHECK: .size llvm_mips_pckev_b_test +; +@llvm_mips_pckev_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_pckev_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_pckev_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_pckev_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_pckev_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_pckev_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.pckev.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_pckev_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.pckev.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_pckev_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: pckev.h +; CHECK: st.h +; CHECK: .size llvm_mips_pckev_h_test +; +@llvm_mips_pckev_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_pckev_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_pckev_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_pckev_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_pckev_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_pckev_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.pckev.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_pckev_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.pckev.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_pckev_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: pckev.w +; CHECK: st.w +; CHECK: .size llvm_mips_pckev_w_test +; +@llvm_mips_pckev_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_pckev_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_pckev_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_pckev_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_pckev_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_pckev_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.pckev.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_pckev_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.pckev.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_pckev_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: pckev.d +; CHECK: st.d +; CHECK: .size llvm_mips_pckev_d_test +; +@llvm_mips_pckod_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_pckod_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_pckod_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_pckod_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_pckod_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_pckod_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.pckod.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_pckod_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.pckod.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_pckod_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: pckod.b +; CHECK: st.b +; CHECK: .size llvm_mips_pckod_b_test +; +@llvm_mips_pckod_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_pckod_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_pckod_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_pckod_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_pckod_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_pckod_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.pckod.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_pckod_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.pckod.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_pckod_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: pckod.h +; CHECK: st.h +; CHECK: .size llvm_mips_pckod_h_test +; +@llvm_mips_pckod_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_pckod_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_pckod_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_pckod_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_pckod_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_pckod_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.pckod.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_pckod_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.pckod.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_pckod_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: pckod.w +; CHECK: st.w +; CHECK: .size llvm_mips_pckod_w_test +; +@llvm_mips_pckod_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_pckod_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_pckod_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_pckod_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_pckod_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_pckod_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.pckod.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_pckod_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.pckod.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_pckod_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: pckod.d +; CHECK: st.d +; CHECK: .size llvm_mips_pckod_d_test +; diff --git a/test/CodeGen/Mips/msa/3r-s.ll b/test/CodeGen/Mips/msa/3r-s.ll new file mode 100644 index 0000000..6c977c6 --- /dev/null +++ b/test/CodeGen/Mips/msa/3r-s.ll @@ -0,0 +1,794 @@ +; RUN: llc -march=mips -mattr=+msa < %s | FileCheck %s + +@llvm_mips_sld_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_sld_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_sld_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_sld_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_sld_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_sld_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.sld.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_sld_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.sld.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_sld_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: sld.b +; CHECK: st.b +; CHECK: .size llvm_mips_sld_b_test +; +@llvm_mips_sld_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_sld_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_sld_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_sld_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_sld_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_sld_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.sld.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_sld_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.sld.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_sld_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: sld.h +; CHECK: st.h +; CHECK: .size llvm_mips_sld_h_test +; +@llvm_mips_sld_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_sld_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_sld_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_sld_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_sld_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_sld_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.sld.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_sld_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.sld.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_sld_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: sld.w +; CHECK: st.w +; CHECK: .size llvm_mips_sld_w_test +; +@llvm_mips_sld_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_sld_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_sld_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_sld_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_sld_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_sld_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.sld.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_sld_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.sld.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_sld_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: sld.d +; CHECK: st.d +; CHECK: .size llvm_mips_sld_d_test +; +@llvm_mips_sll_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_sll_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_sll_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_sll_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_sll_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_sll_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.sll.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_sll_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.sll.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_sll_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: sll.b +; CHECK: st.b +; CHECK: .size llvm_mips_sll_b_test +; +@llvm_mips_sll_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_sll_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_sll_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_sll_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_sll_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_sll_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.sll.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_sll_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.sll.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_sll_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: sll.h +; CHECK: st.h +; CHECK: .size llvm_mips_sll_h_test +; +@llvm_mips_sll_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_sll_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_sll_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_sll_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_sll_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_sll_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.sll.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_sll_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.sll.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_sll_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: sll.w +; CHECK: st.w +; CHECK: .size llvm_mips_sll_w_test +; +@llvm_mips_sll_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_sll_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_sll_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_sll_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_sll_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_sll_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.sll.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_sll_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.sll.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_sll_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: sll.d +; CHECK: st.d +; CHECK: .size llvm_mips_sll_d_test +; +@llvm_mips_sra_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_sra_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_sra_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_sra_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_sra_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_sra_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.sra.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_sra_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.sra.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_sra_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: sra.b +; CHECK: st.b +; CHECK: .size llvm_mips_sra_b_test +; +@llvm_mips_sra_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_sra_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_sra_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_sra_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_sra_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_sra_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.sra.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_sra_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.sra.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_sra_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: sra.h +; CHECK: st.h +; CHECK: .size llvm_mips_sra_h_test +; +@llvm_mips_sra_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_sra_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_sra_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_sra_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_sra_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_sra_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.sra.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_sra_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.sra.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_sra_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: sra.w +; CHECK: st.w +; CHECK: .size llvm_mips_sra_w_test +; +@llvm_mips_sra_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_sra_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_sra_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_sra_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_sra_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_sra_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.sra.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_sra_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.sra.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_sra_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: sra.d +; CHECK: st.d +; CHECK: .size llvm_mips_sra_d_test +; +@llvm_mips_srl_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_srl_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_srl_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_srl_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_srl_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_srl_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.srl.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_srl_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.srl.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_srl_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: srl.b +; CHECK: st.b +; CHECK: .size llvm_mips_srl_b_test +; +@llvm_mips_srl_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_srl_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_srl_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_srl_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_srl_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_srl_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.srl.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_srl_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.srl.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_srl_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: srl.h +; CHECK: st.h +; CHECK: .size llvm_mips_srl_h_test +; +@llvm_mips_srl_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_srl_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_srl_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_srl_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_srl_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_srl_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.srl.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_srl_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.srl.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_srl_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: srl.w +; CHECK: st.w +; CHECK: .size llvm_mips_srl_w_test +; +@llvm_mips_srl_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_srl_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_srl_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_srl_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_srl_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_srl_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.srl.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_srl_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.srl.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_srl_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: srl.d +; CHECK: st.d +; CHECK: .size llvm_mips_srl_d_test +; +@llvm_mips_subs_s_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_subs_s_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_subs_s_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_subs_s_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_subs_s_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_subs_s_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.subs.s.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_subs_s_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.subs.s.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_subs_s_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: subs_s.b +; CHECK: st.b +; CHECK: .size llvm_mips_subs_s_b_test +; +@llvm_mips_subs_s_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_subs_s_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_subs_s_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_subs_s_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_subs_s_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_subs_s_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.subs.s.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_subs_s_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.subs.s.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_subs_s_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: subs_s.h +; CHECK: st.h +; CHECK: .size llvm_mips_subs_s_h_test +; +@llvm_mips_subs_s_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_subs_s_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_subs_s_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_subs_s_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_subs_s_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_subs_s_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.subs.s.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_subs_s_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.subs.s.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_subs_s_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: subs_s.w +; CHECK: st.w +; CHECK: .size llvm_mips_subs_s_w_test +; +@llvm_mips_subs_s_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_subs_s_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_subs_s_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_subs_s_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_subs_s_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_subs_s_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.subs.s.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_subs_s_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.subs.s.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_subs_s_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: subs_s.d +; CHECK: st.d +; CHECK: .size llvm_mips_subs_s_d_test +; +@llvm_mips_subs_u_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_subs_u_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_subs_u_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_subs_u_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_subs_u_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_subs_u_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.subs.u.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_subs_u_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.subs.u.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_subs_u_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: subs_u.b +; CHECK: st.b +; CHECK: .size llvm_mips_subs_u_b_test +; +@llvm_mips_subs_u_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_subs_u_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_subs_u_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_subs_u_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_subs_u_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_subs_u_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.subs.u.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_subs_u_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.subs.u.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_subs_u_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: subs_u.h +; CHECK: st.h +; CHECK: .size llvm_mips_subs_u_h_test +; +@llvm_mips_subs_u_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_subs_u_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_subs_u_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_subs_u_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_subs_u_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_subs_u_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.subs.u.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_subs_u_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.subs.u.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_subs_u_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: subs_u.w +; CHECK: st.w +; CHECK: .size llvm_mips_subs_u_w_test +; +@llvm_mips_subs_u_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_subs_u_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_subs_u_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_subs_u_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_subs_u_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_subs_u_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.subs.u.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_subs_u_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.subs.u.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_subs_u_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: subs_u.d +; CHECK: st.d +; CHECK: .size llvm_mips_subs_u_d_test +; +@llvm_mips_subsus_u_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_subsus_u_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_subsus_u_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_subsus_u_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_subsus_u_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_subsus_u_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.subsus.u.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_subsus_u_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.subsus.u.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_subsus_u_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: subsus_u.b +; CHECK: st.b +; CHECK: .size llvm_mips_subsus_u_b_test +; +@llvm_mips_subsus_u_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_subsus_u_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_subsus_u_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_subsus_u_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_subsus_u_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_subsus_u_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.subsus.u.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_subsus_u_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.subsus.u.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_subsus_u_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: subsus_u.h +; CHECK: st.h +; CHECK: .size llvm_mips_subsus_u_h_test +; +@llvm_mips_subsus_u_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_subsus_u_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_subsus_u_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_subsus_u_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_subsus_u_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_subsus_u_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.subsus.u.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_subsus_u_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.subsus.u.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_subsus_u_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: subsus_u.w +; CHECK: st.w +; CHECK: .size llvm_mips_subsus_u_w_test +; +@llvm_mips_subsus_u_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_subsus_u_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_subsus_u_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_subsus_u_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_subsus_u_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_subsus_u_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.subsus.u.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_subsus_u_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.subsus.u.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_subsus_u_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: subsus_u.d +; CHECK: st.d +; CHECK: .size llvm_mips_subsus_u_d_test +; +@llvm_mips_subsuu_s_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_subsuu_s_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_subsuu_s_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_subsuu_s_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_subsuu_s_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_subsuu_s_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.subsuu.s.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_subsuu_s_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.subsuu.s.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_subsuu_s_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: subsuu_s.b +; CHECK: st.b +; CHECK: .size llvm_mips_subsuu_s_b_test +; +@llvm_mips_subsuu_s_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_subsuu_s_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_subsuu_s_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_subsuu_s_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_subsuu_s_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_subsuu_s_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.subsuu.s.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_subsuu_s_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.subsuu.s.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_subsuu_s_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: subsuu_s.h +; CHECK: st.h +; CHECK: .size llvm_mips_subsuu_s_h_test +; +@llvm_mips_subsuu_s_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_subsuu_s_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_subsuu_s_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_subsuu_s_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_subsuu_s_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_subsuu_s_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.subsuu.s.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_subsuu_s_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.subsuu.s.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_subsuu_s_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: subsuu_s.w +; CHECK: st.w +; CHECK: .size llvm_mips_subsuu_s_w_test +; +@llvm_mips_subsuu_s_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_subsuu_s_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_subsuu_s_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_subsuu_s_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_subsuu_s_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_subsuu_s_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.subsuu.s.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_subsuu_s_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.subsuu.s.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_subsuu_s_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: subsuu_s.d +; CHECK: st.d +; CHECK: .size llvm_mips_subsuu_s_d_test +; +@llvm_mips_subv_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_subv_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_subv_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_subv_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_subv_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_subv_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.subv.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_subv_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.subv.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_subv_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: subv.b +; CHECK: st.b +; CHECK: .size llvm_mips_subv_b_test +; +@llvm_mips_subv_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_subv_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_subv_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_subv_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_subv_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_subv_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.subv.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_subv_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.subv.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_subv_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: subv.h +; CHECK: st.h +; CHECK: .size llvm_mips_subv_h_test +; +@llvm_mips_subv_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_subv_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_subv_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_subv_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_subv_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_subv_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.subv.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_subv_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.subv.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_subv_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: subv.w +; CHECK: st.w +; CHECK: .size llvm_mips_subv_w_test +; +@llvm_mips_subv_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_subv_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_subv_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_subv_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_subv_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_subv_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.subv.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_subv_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.subv.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_subv_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: subv.d +; CHECK: st.d +; CHECK: .size llvm_mips_subv_d_test +; diff --git a/test/CodeGen/Mips/msa/3r-v.ll b/test/CodeGen/Mips/msa/3r-v.ll new file mode 100644 index 0000000..5c2ab9b --- /dev/null +++ b/test/CodeGen/Mips/msa/3r-v.ll @@ -0,0 +1,90 @@ +; RUN: llc -march=mips -mattr=+msa < %s | FileCheck %s + +@llvm_mips_vshf_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_vshf_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_vshf_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_vshf_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_vshf_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_vshf_b_ARG2 + %2 = tail call <16 x i8> @llvm.mips.vshf.b(<16 x i8> %0, <16 x i8> %1) + store <16 x i8> %2, <16 x i8>* @llvm_mips_vshf_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.vshf.b(<16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_vshf_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: vshf.b +; CHECK: st.b +; CHECK: .size llvm_mips_vshf_b_test +; +@llvm_mips_vshf_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_vshf_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_vshf_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_vshf_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_vshf_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_vshf_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.vshf.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_vshf_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.vshf.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_vshf_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: vshf.h +; CHECK: st.h +; CHECK: .size llvm_mips_vshf_h_test +; +@llvm_mips_vshf_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_vshf_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_vshf_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_vshf_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_vshf_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_vshf_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.vshf.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_vshf_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.vshf.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_vshf_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: vshf.w +; CHECK: st.w +; CHECK: .size llvm_mips_vshf_w_test +; +@llvm_mips_vshf_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_vshf_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_vshf_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_vshf_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_vshf_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_vshf_d_ARG2 + %2 = tail call <2 x i64> @llvm.mips.vshf.d(<2 x i64> %0, <2 x i64> %1) + store <2 x i64> %2, <2 x i64>* @llvm_mips_vshf_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.vshf.d(<2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_vshf_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: vshf.d +; CHECK: st.d +; CHECK: .size llvm_mips_vshf_d_test +; diff --git a/test/CodeGen/Mips/msa/3r_4r.ll b/test/CodeGen/Mips/msa/3r_4r.ll new file mode 100644 index 0000000..c7d189e --- /dev/null +++ b/test/CodeGen/Mips/msa/3r_4r.ll @@ -0,0 +1,202 @@ +; RUN: llc -march=mips -mattr=+msa < %s | FileCheck %s + +@llvm_mips_maddv_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_maddv_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_maddv_b_ARG3 = global <16 x i8> <i8 32, i8 33, i8 34, i8 35, i8 36, i8 37, i8 38, i8 39, i8 40, i8 41, i8 42, i8 43, i8 44, i8 45, i8 46, i8 47>, align 16 +@llvm_mips_maddv_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_maddv_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_maddv_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_maddv_b_ARG2 + %2 = load <16 x i8>* @llvm_mips_maddv_b_ARG3 + %3 = tail call <16 x i8> @llvm.mips.maddv.b(<16 x i8> %0, <16 x i8> %1, <16 x i8> %2) + store <16 x i8> %3, <16 x i8>* @llvm_mips_maddv_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.maddv.b(<16 x i8>, <16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_maddv_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: ld.b +; CHECK: maddv.b +; CHECK: st.b +; CHECK: .size llvm_mips_maddv_b_test +; +@llvm_mips_maddv_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_maddv_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_maddv_h_ARG3 = global <8 x i16> <i16 16, i16 17, i16 18, i16 19, i16 20, i16 21, i16 22, i16 23>, align 16 +@llvm_mips_maddv_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_maddv_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_maddv_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_maddv_h_ARG2 + %2 = load <8 x i16>* @llvm_mips_maddv_h_ARG3 + %3 = tail call <8 x i16> @llvm.mips.maddv.h(<8 x i16> %0, <8 x i16> %1, <8 x i16> %2) + store <8 x i16> %3, <8 x i16>* @llvm_mips_maddv_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.maddv.h(<8 x i16>, <8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_maddv_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: ld.h +; CHECK: maddv.h +; CHECK: st.h +; CHECK: .size llvm_mips_maddv_h_test +; +@llvm_mips_maddv_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_maddv_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_maddv_w_ARG3 = global <4 x i32> <i32 8, i32 9, i32 10, i32 11>, align 16 +@llvm_mips_maddv_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_maddv_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_maddv_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_maddv_w_ARG2 + %2 = load <4 x i32>* @llvm_mips_maddv_w_ARG3 + %3 = tail call <4 x i32> @llvm.mips.maddv.w(<4 x i32> %0, <4 x i32> %1, <4 x i32> %2) + store <4 x i32> %3, <4 x i32>* @llvm_mips_maddv_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.maddv.w(<4 x i32>, <4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_maddv_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: ld.w +; CHECK: maddv.w +; CHECK: st.w +; CHECK: .size llvm_mips_maddv_w_test +; +@llvm_mips_maddv_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_maddv_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_maddv_d_ARG3 = global <2 x i64> <i64 4, i64 5>, align 16 +@llvm_mips_maddv_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_maddv_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_maddv_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_maddv_d_ARG2 + %2 = load <2 x i64>* @llvm_mips_maddv_d_ARG3 + %3 = tail call <2 x i64> @llvm.mips.maddv.d(<2 x i64> %0, <2 x i64> %1, <2 x i64> %2) + store <2 x i64> %3, <2 x i64>* @llvm_mips_maddv_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.maddv.d(<2 x i64>, <2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_maddv_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: ld.d +; CHECK: maddv.d +; CHECK: st.d +; CHECK: .size llvm_mips_maddv_d_test +; +@llvm_mips_msubv_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_msubv_b_ARG2 = global <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, align 16 +@llvm_mips_msubv_b_ARG3 = global <16 x i8> <i8 32, i8 33, i8 34, i8 35, i8 36, i8 37, i8 38, i8 39, i8 40, i8 41, i8 42, i8 43, i8 44, i8 45, i8 46, i8 47>, align 16 +@llvm_mips_msubv_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_msubv_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_msubv_b_ARG1 + %1 = load <16 x i8>* @llvm_mips_msubv_b_ARG2 + %2 = load <16 x i8>* @llvm_mips_msubv_b_ARG3 + %3 = tail call <16 x i8> @llvm.mips.msubv.b(<16 x i8> %0, <16 x i8> %1, <16 x i8> %2) + store <16 x i8> %3, <16 x i8>* @llvm_mips_msubv_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.msubv.b(<16 x i8>, <16 x i8>, <16 x i8>) nounwind + +; CHECK: llvm_mips_msubv_b_test: +; CHECK: ld.b +; CHECK: ld.b +; CHECK: ld.b +; CHECK: msubv.b +; CHECK: st.b +; CHECK: .size llvm_mips_msubv_b_test +; +@llvm_mips_msubv_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_msubv_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_msubv_h_ARG3 = global <8 x i16> <i16 16, i16 17, i16 18, i16 19, i16 20, i16 21, i16 22, i16 23>, align 16 +@llvm_mips_msubv_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_msubv_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_msubv_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_msubv_h_ARG2 + %2 = load <8 x i16>* @llvm_mips_msubv_h_ARG3 + %3 = tail call <8 x i16> @llvm.mips.msubv.h(<8 x i16> %0, <8 x i16> %1, <8 x i16> %2) + store <8 x i16> %3, <8 x i16>* @llvm_mips_msubv_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.msubv.h(<8 x i16>, <8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_msubv_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: ld.h +; CHECK: msubv.h +; CHECK: st.h +; CHECK: .size llvm_mips_msubv_h_test +; +@llvm_mips_msubv_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_msubv_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_msubv_w_ARG3 = global <4 x i32> <i32 8, i32 9, i32 10, i32 11>, align 16 +@llvm_mips_msubv_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_msubv_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_msubv_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_msubv_w_ARG2 + %2 = load <4 x i32>* @llvm_mips_msubv_w_ARG3 + %3 = tail call <4 x i32> @llvm.mips.msubv.w(<4 x i32> %0, <4 x i32> %1, <4 x i32> %2) + store <4 x i32> %3, <4 x i32>* @llvm_mips_msubv_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.msubv.w(<4 x i32>, <4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_msubv_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: ld.w +; CHECK: msubv.w +; CHECK: st.w +; CHECK: .size llvm_mips_msubv_w_test +; +@llvm_mips_msubv_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_msubv_d_ARG2 = global <2 x i64> <i64 2, i64 3>, align 16 +@llvm_mips_msubv_d_ARG3 = global <2 x i64> <i64 4, i64 5>, align 16 +@llvm_mips_msubv_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_msubv_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_msubv_d_ARG1 + %1 = load <2 x i64>* @llvm_mips_msubv_d_ARG2 + %2 = load <2 x i64>* @llvm_mips_msubv_d_ARG3 + %3 = tail call <2 x i64> @llvm.mips.msubv.d(<2 x i64> %0, <2 x i64> %1, <2 x i64> %2) + store <2 x i64> %3, <2 x i64>* @llvm_mips_msubv_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.msubv.d(<2 x i64>, <2 x i64>, <2 x i64>) nounwind + +; CHECK: llvm_mips_msubv_d_test: +; CHECK: ld.d +; CHECK: ld.d +; CHECK: ld.d +; CHECK: msubv.d +; CHECK: st.d +; CHECK: .size llvm_mips_msubv_d_test +; diff --git a/test/CodeGen/Mips/msa/3r_splat.ll b/test/CodeGen/Mips/msa/3r_splat.ll new file mode 100644 index 0000000..dad61eb --- /dev/null +++ b/test/CodeGen/Mips/msa/3r_splat.ll @@ -0,0 +1,78 @@ +; RUN: llc -march=mips -mattr=+msa < %s | FileCheck %s + +@llvm_mips_splat_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_splat_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_splat_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_splat_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.splat.b(<16 x i8> %0, i32 3) + store <16 x i8> %1, <16 x i8>* @llvm_mips_splat_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.splat.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_splat_b_test: +; CHECK: ld.b +; CHECK: splat.b +; CHECK: st.b +; CHECK: .size llvm_mips_splat_b_test +; +@llvm_mips_splat_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_splat_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_splat_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_splat_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.splat.h(<8 x i16> %0, i32 3) + store <8 x i16> %1, <8 x i16>* @llvm_mips_splat_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.splat.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_splat_h_test: +; CHECK: ld.h +; CHECK: splat.h +; CHECK: st.h +; CHECK: .size llvm_mips_splat_h_test +; +@llvm_mips_splat_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_splat_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_splat_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_splat_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.splat.w(<4 x i32> %0, i32 3) + store <4 x i32> %1, <4 x i32>* @llvm_mips_splat_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.splat.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_splat_w_test: +; CHECK: ld.w +; CHECK: splat.w +; CHECK: st.w +; CHECK: .size llvm_mips_splat_w_test +; +@llvm_mips_splat_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_splat_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_splat_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_splat_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.splat.d(<2 x i64> %0, i32 3) + store <2 x i64> %1, <2 x i64>* @llvm_mips_splat_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.splat.d(<2 x i64>, i32) nounwind + +; CHECK: llvm_mips_splat_d_test: +; CHECK: ld.d +; CHECK: splat.d +; CHECK: st.d +; CHECK: .size llvm_mips_splat_d_test +; diff --git a/test/CodeGen/Mips/msa/3rf_4rf_q.ll b/test/CodeGen/Mips/msa/3rf_4rf_q.ll new file mode 100644 index 0000000..b490e18 --- /dev/null +++ b/test/CodeGen/Mips/msa/3rf_4rf_q.ll @@ -0,0 +1,202 @@ +; RUN: llc -march=mips -mattr=+msa < %s | FileCheck %s + +@llvm_mips_madd_q_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_madd_q_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_madd_q_h_ARG3 = global <8 x i16> <i16 16, i16 17, i16 18, i16 19, i16 20, i16 21, i16 22, i16 23>, align 16 +@llvm_mips_madd_q_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_madd_q_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_madd_q_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_madd_q_h_ARG2 + %2 = load <8 x i16>* @llvm_mips_madd_q_h_ARG3 + %3 = tail call <8 x i16> @llvm.mips.madd.q.h(<8 x i16> %0, <8 x i16> %1, <8 x i16> %2) + store <8 x i16> %3, <8 x i16>* @llvm_mips_madd_q_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.madd.q.h(<8 x i16>, <8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_madd_q_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: ld.h +; CHECK: madd_q.h +; CHECK: st.h +; CHECK: .size llvm_mips_madd_q_h_test +; +@llvm_mips_madd_q_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_madd_q_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_madd_q_w_ARG3 = global <4 x i32> <i32 8, i32 9, i32 10, i32 11>, align 16 +@llvm_mips_madd_q_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_madd_q_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_madd_q_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_madd_q_w_ARG2 + %2 = load <4 x i32>* @llvm_mips_madd_q_w_ARG3 + %3 = tail call <4 x i32> @llvm.mips.madd.q.w(<4 x i32> %0, <4 x i32> %1, <4 x i32> %2) + store <4 x i32> %3, <4 x i32>* @llvm_mips_madd_q_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.madd.q.w(<4 x i32>, <4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_madd_q_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: ld.w +; CHECK: madd_q.w +; CHECK: st.w +; CHECK: .size llvm_mips_madd_q_w_test +; +@llvm_mips_maddr_q_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_maddr_q_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_maddr_q_h_ARG3 = global <8 x i16> <i16 16, i16 17, i16 18, i16 19, i16 20, i16 21, i16 22, i16 23>, align 16 +@llvm_mips_maddr_q_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_maddr_q_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_maddr_q_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_maddr_q_h_ARG2 + %2 = load <8 x i16>* @llvm_mips_maddr_q_h_ARG3 + %3 = tail call <8 x i16> @llvm.mips.maddr.q.h(<8 x i16> %0, <8 x i16> %1, <8 x i16> %2) + store <8 x i16> %3, <8 x i16>* @llvm_mips_maddr_q_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.maddr.q.h(<8 x i16>, <8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_maddr_q_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: ld.h +; CHECK: maddr_q.h +; CHECK: st.h +; CHECK: .size llvm_mips_maddr_q_h_test +; +@llvm_mips_maddr_q_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_maddr_q_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_maddr_q_w_ARG3 = global <4 x i32> <i32 8, i32 9, i32 10, i32 11>, align 16 +@llvm_mips_maddr_q_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_maddr_q_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_maddr_q_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_maddr_q_w_ARG2 + %2 = load <4 x i32>* @llvm_mips_maddr_q_w_ARG3 + %3 = tail call <4 x i32> @llvm.mips.maddr.q.w(<4 x i32> %0, <4 x i32> %1, <4 x i32> %2) + store <4 x i32> %3, <4 x i32>* @llvm_mips_maddr_q_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.maddr.q.w(<4 x i32>, <4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_maddr_q_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: ld.w +; CHECK: maddr_q.w +; CHECK: st.w +; CHECK: .size llvm_mips_maddr_q_w_test +; +@llvm_mips_msub_q_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_msub_q_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_msub_q_h_ARG3 = global <8 x i16> <i16 16, i16 17, i16 18, i16 19, i16 20, i16 21, i16 22, i16 23>, align 16 +@llvm_mips_msub_q_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_msub_q_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_msub_q_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_msub_q_h_ARG2 + %2 = load <8 x i16>* @llvm_mips_msub_q_h_ARG3 + %3 = tail call <8 x i16> @llvm.mips.msub.q.h(<8 x i16> %0, <8 x i16> %1, <8 x i16> %2) + store <8 x i16> %3, <8 x i16>* @llvm_mips_msub_q_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.msub.q.h(<8 x i16>, <8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_msub_q_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: ld.h +; CHECK: msub_q.h +; CHECK: st.h +; CHECK: .size llvm_mips_msub_q_h_test +; +@llvm_mips_msub_q_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_msub_q_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_msub_q_w_ARG3 = global <4 x i32> <i32 8, i32 9, i32 10, i32 11>, align 16 +@llvm_mips_msub_q_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_msub_q_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_msub_q_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_msub_q_w_ARG2 + %2 = load <4 x i32>* @llvm_mips_msub_q_w_ARG3 + %3 = tail call <4 x i32> @llvm.mips.msub.q.w(<4 x i32> %0, <4 x i32> %1, <4 x i32> %2) + store <4 x i32> %3, <4 x i32>* @llvm_mips_msub_q_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.msub.q.w(<4 x i32>, <4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_msub_q_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: ld.w +; CHECK: msub_q.w +; CHECK: st.w +; CHECK: .size llvm_mips_msub_q_w_test +; +@llvm_mips_msubr_q_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_msubr_q_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_msubr_q_h_ARG3 = global <8 x i16> <i16 16, i16 17, i16 18, i16 19, i16 20, i16 21, i16 22, i16 23>, align 16 +@llvm_mips_msubr_q_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_msubr_q_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_msubr_q_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_msubr_q_h_ARG2 + %2 = load <8 x i16>* @llvm_mips_msubr_q_h_ARG3 + %3 = tail call <8 x i16> @llvm.mips.msubr.q.h(<8 x i16> %0, <8 x i16> %1, <8 x i16> %2) + store <8 x i16> %3, <8 x i16>* @llvm_mips_msubr_q_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.msubr.q.h(<8 x i16>, <8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_msubr_q_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: ld.h +; CHECK: msubr_q.h +; CHECK: st.h +; CHECK: .size llvm_mips_msubr_q_h_test +; +@llvm_mips_msubr_q_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_msubr_q_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_msubr_q_w_ARG3 = global <4 x i32> <i32 8, i32 9, i32 10, i32 11>, align 16 +@llvm_mips_msubr_q_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_msubr_q_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_msubr_q_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_msubr_q_w_ARG2 + %2 = load <4 x i32>* @llvm_mips_msubr_q_w_ARG3 + %3 = tail call <4 x i32> @llvm.mips.msubr.q.w(<4 x i32> %0, <4 x i32> %1, <4 x i32> %2) + store <4 x i32> %3, <4 x i32>* @llvm_mips_msubr_q_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.msubr.q.w(<4 x i32>, <4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_msubr_q_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: ld.w +; CHECK: msubr_q.w +; CHECK: st.w +; CHECK: .size llvm_mips_msubr_q_w_test +; diff --git a/test/CodeGen/Mips/msa/3rf_q.ll b/test/CodeGen/Mips/msa/3rf_q.ll new file mode 100644 index 0000000..748fd9c --- /dev/null +++ b/test/CodeGen/Mips/msa/3rf_q.ll @@ -0,0 +1,90 @@ +; RUN: llc -march=mips -mattr=+msa < %s | FileCheck %s + +@llvm_mips_mul_q_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_mul_q_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_mul_q_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_mul_q_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_mul_q_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_mul_q_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.mul.q.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_mul_q_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.mul.q.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_mul_q_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: mul_q.h +; CHECK: st.h +; CHECK: .size llvm_mips_mul_q_h_test +; +@llvm_mips_mul_q_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_mul_q_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_mul_q_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_mul_q_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_mul_q_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_mul_q_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.mul.q.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_mul_q_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.mul.q.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_mul_q_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: mul_q.w +; CHECK: st.w +; CHECK: .size llvm_mips_mul_q_w_test +; +@llvm_mips_mulr_q_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_mulr_q_h_ARG2 = global <8 x i16> <i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, align 16 +@llvm_mips_mulr_q_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_mulr_q_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_mulr_q_h_ARG1 + %1 = load <8 x i16>* @llvm_mips_mulr_q_h_ARG2 + %2 = tail call <8 x i16> @llvm.mips.mulr.q.h(<8 x i16> %0, <8 x i16> %1) + store <8 x i16> %2, <8 x i16>* @llvm_mips_mulr_q_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.mulr.q.h(<8 x i16>, <8 x i16>) nounwind + +; CHECK: llvm_mips_mulr_q_h_test: +; CHECK: ld.h +; CHECK: ld.h +; CHECK: mulr_q.h +; CHECK: st.h +; CHECK: .size llvm_mips_mulr_q_h_test +; +@llvm_mips_mulr_q_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_mulr_q_w_ARG2 = global <4 x i32> <i32 4, i32 5, i32 6, i32 7>, align 16 +@llvm_mips_mulr_q_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_mulr_q_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_mulr_q_w_ARG1 + %1 = load <4 x i32>* @llvm_mips_mulr_q_w_ARG2 + %2 = tail call <4 x i32> @llvm.mips.mulr.q.w(<4 x i32> %0, <4 x i32> %1) + store <4 x i32> %2, <4 x i32>* @llvm_mips_mulr_q_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.mulr.q.w(<4 x i32>, <4 x i32>) nounwind + +; CHECK: llvm_mips_mulr_q_w_test: +; CHECK: ld.w +; CHECK: ld.w +; CHECK: mulr_q.w +; CHECK: st.w +; CHECK: .size llvm_mips_mulr_q_w_test +; diff --git a/test/CodeGen/Mips/msa/bit.ll b/test/CodeGen/Mips/msa/bit.ll new file mode 100644 index 0000000..fe36ed7 --- /dev/null +++ b/test/CodeGen/Mips/msa/bit.ll @@ -0,0 +1,382 @@ +; RUN: llc -march=mips -mattr=+msa < %s | FileCheck %s + +@llvm_mips_sat_s_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_sat_s_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_sat_s_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_sat_s_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.sat.s.b(<16 x i8> %0, i32 7) + store <16 x i8> %1, <16 x i8>* @llvm_mips_sat_s_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.sat.s.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_sat_s_b_test: +; CHECK: ld.b +; CHECK: sat_s.b +; CHECK: st.b +; CHECK: .size llvm_mips_sat_s_b_test +; +@llvm_mips_sat_s_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_sat_s_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_sat_s_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_sat_s_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.sat.s.h(<8 x i16> %0, i32 7) + store <8 x i16> %1, <8 x i16>* @llvm_mips_sat_s_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.sat.s.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_sat_s_h_test: +; CHECK: ld.h +; CHECK: sat_s.h +; CHECK: st.h +; CHECK: .size llvm_mips_sat_s_h_test +; +@llvm_mips_sat_s_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_sat_s_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_sat_s_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_sat_s_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.sat.s.w(<4 x i32> %0, i32 7) + store <4 x i32> %1, <4 x i32>* @llvm_mips_sat_s_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.sat.s.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_sat_s_w_test: +; CHECK: ld.w +; CHECK: sat_s.w +; CHECK: st.w +; CHECK: .size llvm_mips_sat_s_w_test +; +@llvm_mips_sat_s_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_sat_s_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_sat_s_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_sat_s_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.sat.s.d(<2 x i64> %0, i32 7) + store <2 x i64> %1, <2 x i64>* @llvm_mips_sat_s_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.sat.s.d(<2 x i64>, i32) nounwind + +; CHECK: llvm_mips_sat_s_d_test: +; CHECK: ld.d +; CHECK: sat_s.d +; CHECK: st.d +; CHECK: .size llvm_mips_sat_s_d_test +; +@llvm_mips_sat_u_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_sat_u_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_sat_u_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_sat_u_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.sat.u.b(<16 x i8> %0, i32 7) + store <16 x i8> %1, <16 x i8>* @llvm_mips_sat_u_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.sat.u.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_sat_u_b_test: +; CHECK: ld.b +; CHECK: sat_u.b +; CHECK: st.b +; CHECK: .size llvm_mips_sat_u_b_test +; +@llvm_mips_sat_u_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_sat_u_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_sat_u_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_sat_u_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.sat.u.h(<8 x i16> %0, i32 7) + store <8 x i16> %1, <8 x i16>* @llvm_mips_sat_u_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.sat.u.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_sat_u_h_test: +; CHECK: ld.h +; CHECK: sat_u.h +; CHECK: st.h +; CHECK: .size llvm_mips_sat_u_h_test +; +@llvm_mips_sat_u_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_sat_u_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_sat_u_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_sat_u_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.sat.u.w(<4 x i32> %0, i32 7) + store <4 x i32> %1, <4 x i32>* @llvm_mips_sat_u_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.sat.u.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_sat_u_w_test: +; CHECK: ld.w +; CHECK: sat_u.w +; CHECK: st.w +; CHECK: .size llvm_mips_sat_u_w_test +; +@llvm_mips_sat_u_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_sat_u_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_sat_u_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_sat_u_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.sat.u.d(<2 x i64> %0, i32 7) + store <2 x i64> %1, <2 x i64>* @llvm_mips_sat_u_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.sat.u.d(<2 x i64>, i32) nounwind + +; CHECK: llvm_mips_sat_u_d_test: +; CHECK: ld.d +; CHECK: sat_u.d +; CHECK: st.d +; CHECK: .size llvm_mips_sat_u_d_test +; +@llvm_mips_slli_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_slli_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_slli_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_slli_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.slli.b(<16 x i8> %0, i32 7) + store <16 x i8> %1, <16 x i8>* @llvm_mips_slli_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.slli.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_slli_b_test: +; CHECK: ld.b +; CHECK: slli.b +; CHECK: st.b +; CHECK: .size llvm_mips_slli_b_test +; +@llvm_mips_slli_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_slli_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_slli_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_slli_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.slli.h(<8 x i16> %0, i32 7) + store <8 x i16> %1, <8 x i16>* @llvm_mips_slli_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.slli.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_slli_h_test: +; CHECK: ld.h +; CHECK: slli.h +; CHECK: st.h +; CHECK: .size llvm_mips_slli_h_test +; +@llvm_mips_slli_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_slli_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_slli_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_slli_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.slli.w(<4 x i32> %0, i32 7) + store <4 x i32> %1, <4 x i32>* @llvm_mips_slli_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.slli.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_slli_w_test: +; CHECK: ld.w +; CHECK: slli.w +; CHECK: st.w +; CHECK: .size llvm_mips_slli_w_test +; +@llvm_mips_slli_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_slli_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_slli_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_slli_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.slli.d(<2 x i64> %0, i32 7) + store <2 x i64> %1, <2 x i64>* @llvm_mips_slli_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.slli.d(<2 x i64>, i32) nounwind + +; CHECK: llvm_mips_slli_d_test: +; CHECK: ld.d +; CHECK: slli.d +; CHECK: st.d +; CHECK: .size llvm_mips_slli_d_test +; +@llvm_mips_srai_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_srai_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_srai_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_srai_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.srai.b(<16 x i8> %0, i32 7) + store <16 x i8> %1, <16 x i8>* @llvm_mips_srai_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.srai.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_srai_b_test: +; CHECK: ld.b +; CHECK: srai.b +; CHECK: st.b +; CHECK: .size llvm_mips_srai_b_test +; +@llvm_mips_srai_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_srai_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_srai_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_srai_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.srai.h(<8 x i16> %0, i32 7) + store <8 x i16> %1, <8 x i16>* @llvm_mips_srai_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.srai.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_srai_h_test: +; CHECK: ld.h +; CHECK: srai.h +; CHECK: st.h +; CHECK: .size llvm_mips_srai_h_test +; +@llvm_mips_srai_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_srai_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_srai_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_srai_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.srai.w(<4 x i32> %0, i32 7) + store <4 x i32> %1, <4 x i32>* @llvm_mips_srai_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.srai.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_srai_w_test: +; CHECK: ld.w +; CHECK: srai.w +; CHECK: st.w +; CHECK: .size llvm_mips_srai_w_test +; +@llvm_mips_srai_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_srai_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_srai_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_srai_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.srai.d(<2 x i64> %0, i32 7) + store <2 x i64> %1, <2 x i64>* @llvm_mips_srai_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.srai.d(<2 x i64>, i32) nounwind + +; CHECK: llvm_mips_srai_d_test: +; CHECK: ld.d +; CHECK: srai.d +; CHECK: st.d +; CHECK: .size llvm_mips_srai_d_test +; +@llvm_mips_srli_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_srli_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_srli_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_srli_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.srli.b(<16 x i8> %0, i32 7) + store <16 x i8> %1, <16 x i8>* @llvm_mips_srli_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.srli.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_srli_b_test: +; CHECK: ld.b +; CHECK: srli.b +; CHECK: st.b +; CHECK: .size llvm_mips_srli_b_test +; +@llvm_mips_srli_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_srli_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_srli_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_srli_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.srli.h(<8 x i16> %0, i32 7) + store <8 x i16> %1, <8 x i16>* @llvm_mips_srli_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.srli.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_srli_h_test: +; CHECK: ld.h +; CHECK: srli.h +; CHECK: st.h +; CHECK: .size llvm_mips_srli_h_test +; +@llvm_mips_srli_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_srli_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_srli_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_srli_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.srli.w(<4 x i32> %0, i32 7) + store <4 x i32> %1, <4 x i32>* @llvm_mips_srli_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.srli.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_srli_w_test: +; CHECK: ld.w +; CHECK: srli.w +; CHECK: st.w +; CHECK: .size llvm_mips_srli_w_test +; +@llvm_mips_srli_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_srli_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_srli_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_srli_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.srli.d(<2 x i64> %0, i32 7) + store <2 x i64> %1, <2 x i64>* @llvm_mips_srli_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.srli.d(<2 x i64>, i32) nounwind + +; CHECK: llvm_mips_srli_d_test: +; CHECK: ld.d +; CHECK: srli.d +; CHECK: st.d +; CHECK: .size llvm_mips_srli_d_test +; diff --git a/test/CodeGen/Mips/msa/elm_shift_slide.ll b/test/CodeGen/Mips/msa/elm_shift_slide.ll new file mode 100644 index 0000000..5bddeaf --- /dev/null +++ b/test/CodeGen/Mips/msa/elm_shift_slide.ll @@ -0,0 +1,154 @@ +; RUN: llc -march=mips -mattr=+msa < %s | FileCheck %s + +@llvm_mips_sldi_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_sldi_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_sldi_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_sldi_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.sldi.b(<16 x i8> %0, i32 1) + store <16 x i8> %1, <16 x i8>* @llvm_mips_sldi_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.sldi.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_sldi_b_test: +; CHECK: ld.b +; CHECK: sldi.b +; CHECK: st.b +; CHECK: .size llvm_mips_sldi_b_test +; +@llvm_mips_sldi_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_sldi_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_sldi_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_sldi_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.sldi.h(<8 x i16> %0, i32 1) + store <8 x i16> %1, <8 x i16>* @llvm_mips_sldi_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.sldi.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_sldi_h_test: +; CHECK: ld.h +; CHECK: sldi.h +; CHECK: st.h +; CHECK: .size llvm_mips_sldi_h_test +; +@llvm_mips_sldi_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_sldi_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_sldi_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_sldi_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.sldi.w(<4 x i32> %0, i32 1) + store <4 x i32> %1, <4 x i32>* @llvm_mips_sldi_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.sldi.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_sldi_w_test: +; CHECK: ld.w +; CHECK: sldi.w +; CHECK: st.w +; CHECK: .size llvm_mips_sldi_w_test +; +@llvm_mips_sldi_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_sldi_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_sldi_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_sldi_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.sldi.d(<2 x i64> %0, i32 1) + store <2 x i64> %1, <2 x i64>* @llvm_mips_sldi_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.sldi.d(<2 x i64>, i32) nounwind + +; CHECK: llvm_mips_sldi_d_test: +; CHECK: ld.d +; CHECK: sldi.d +; CHECK: st.d +; CHECK: .size llvm_mips_sldi_d_test +; +@llvm_mips_splati_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_splati_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_splati_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_splati_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.splati.b(<16 x i8> %0, i32 1) + store <16 x i8> %1, <16 x i8>* @llvm_mips_splati_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.splati.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_splati_b_test: +; CHECK: ld.b +; CHECK: splati.b +; CHECK: st.b +; CHECK: .size llvm_mips_splati_b_test +; +@llvm_mips_splati_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_splati_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_splati_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_splati_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.splati.h(<8 x i16> %0, i32 1) + store <8 x i16> %1, <8 x i16>* @llvm_mips_splati_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.splati.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_splati_h_test: +; CHECK: ld.h +; CHECK: splati.h +; CHECK: st.h +; CHECK: .size llvm_mips_splati_h_test +; +@llvm_mips_splati_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_splati_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_splati_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_splati_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.splati.w(<4 x i32> %0, i32 1) + store <4 x i32> %1, <4 x i32>* @llvm_mips_splati_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.splati.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_splati_w_test: +; CHECK: ld.w +; CHECK: splati.w +; CHECK: st.w +; CHECK: .size llvm_mips_splati_w_test +; +@llvm_mips_splati_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_splati_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_splati_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_splati_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.splati.d(<2 x i64> %0, i32 1) + store <2 x i64> %1, <2 x i64>* @llvm_mips_splati_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.splati.d(<2 x i64>, i32) nounwind + +; CHECK: llvm_mips_splati_d_test: +; CHECK: ld.d +; CHECK: splati.d +; CHECK: st.d +; CHECK: .size llvm_mips_splati_d_test +; diff --git a/test/CodeGen/Mips/msa/i5-m.ll b/test/CodeGen/Mips/msa/i5-m.ll new file mode 100644 index 0000000..9e35848 --- /dev/null +++ b/test/CodeGen/Mips/msa/i5-m.ll @@ -0,0 +1,306 @@ +; RUN: llc -march=mips -mattr=+msa < %s | FileCheck %s + +@llvm_mips_maxi_s_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_maxi_s_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_maxi_s_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_maxi_s_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.maxi.s.b(<16 x i8> %0, i32 14) + store <16 x i8> %1, <16 x i8>* @llvm_mips_maxi_s_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.maxi.s.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_maxi_s_b_test: +; CHECK: ld.b +; CHECK: maxi_s.b +; CHECK: st.b +; CHECK: .size llvm_mips_maxi_s_b_test +; +@llvm_mips_maxi_s_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_maxi_s_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_maxi_s_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_maxi_s_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.maxi.s.h(<8 x i16> %0, i32 14) + store <8 x i16> %1, <8 x i16>* @llvm_mips_maxi_s_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.maxi.s.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_maxi_s_h_test: +; CHECK: ld.h +; CHECK: maxi_s.h +; CHECK: st.h +; CHECK: .size llvm_mips_maxi_s_h_test +; +@llvm_mips_maxi_s_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_maxi_s_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_maxi_s_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_maxi_s_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.maxi.s.w(<4 x i32> %0, i32 14) + store <4 x i32> %1, <4 x i32>* @llvm_mips_maxi_s_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.maxi.s.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_maxi_s_w_test: +; CHECK: ld.w +; CHECK: maxi_s.w +; CHECK: st.w +; CHECK: .size llvm_mips_maxi_s_w_test +; +@llvm_mips_maxi_s_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_maxi_s_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_maxi_s_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_maxi_s_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.maxi.s.d(<2 x i64> %0, i32 14) + store <2 x i64> %1, <2 x i64>* @llvm_mips_maxi_s_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.maxi.s.d(<2 x i64>, i32) nounwind + +; CHECK: llvm_mips_maxi_s_d_test: +; CHECK: ld.d +; CHECK: maxi_s.d +; CHECK: st.d +; CHECK: .size llvm_mips_maxi_s_d_test +; +@llvm_mips_maxi_u_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_maxi_u_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_maxi_u_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_maxi_u_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.maxi.u.b(<16 x i8> %0, i32 14) + store <16 x i8> %1, <16 x i8>* @llvm_mips_maxi_u_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.maxi.u.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_maxi_u_b_test: +; CHECK: ld.b +; CHECK: maxi_u.b +; CHECK: st.b +; CHECK: .size llvm_mips_maxi_u_b_test +; +@llvm_mips_maxi_u_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_maxi_u_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_maxi_u_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_maxi_u_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.maxi.u.h(<8 x i16> %0, i32 14) + store <8 x i16> %1, <8 x i16>* @llvm_mips_maxi_u_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.maxi.u.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_maxi_u_h_test: +; CHECK: ld.h +; CHECK: maxi_u.h +; CHECK: st.h +; CHECK: .size llvm_mips_maxi_u_h_test +; +@llvm_mips_maxi_u_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_maxi_u_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_maxi_u_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_maxi_u_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.maxi.u.w(<4 x i32> %0, i32 14) + store <4 x i32> %1, <4 x i32>* @llvm_mips_maxi_u_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.maxi.u.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_maxi_u_w_test: +; CHECK: ld.w +; CHECK: maxi_u.w +; CHECK: st.w +; CHECK: .size llvm_mips_maxi_u_w_test +; +@llvm_mips_maxi_u_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_maxi_u_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_maxi_u_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_maxi_u_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.maxi.u.d(<2 x i64> %0, i32 14) + store <2 x i64> %1, <2 x i64>* @llvm_mips_maxi_u_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.maxi.u.d(<2 x i64>, i32) nounwind + +; CHECK: llvm_mips_maxi_u_d_test: +; CHECK: ld.d +; CHECK: maxi_u.d +; CHECK: st.d +; CHECK: .size llvm_mips_maxi_u_d_test +; +@llvm_mips_mini_s_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_mini_s_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_mini_s_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_mini_s_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.mini.s.b(<16 x i8> %0, i32 14) + store <16 x i8> %1, <16 x i8>* @llvm_mips_mini_s_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.mini.s.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_mini_s_b_test: +; CHECK: ld.b +; CHECK: mini_s.b +; CHECK: st.b +; CHECK: .size llvm_mips_mini_s_b_test +; +@llvm_mips_mini_s_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_mini_s_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_mini_s_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_mini_s_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.mini.s.h(<8 x i16> %0, i32 14) + store <8 x i16> %1, <8 x i16>* @llvm_mips_mini_s_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.mini.s.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_mini_s_h_test: +; CHECK: ld.h +; CHECK: mini_s.h +; CHECK: st.h +; CHECK: .size llvm_mips_mini_s_h_test +; +@llvm_mips_mini_s_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_mini_s_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_mini_s_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_mini_s_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.mini.s.w(<4 x i32> %0, i32 14) + store <4 x i32> %1, <4 x i32>* @llvm_mips_mini_s_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.mini.s.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_mini_s_w_test: +; CHECK: ld.w +; CHECK: mini_s.w +; CHECK: st.w +; CHECK: .size llvm_mips_mini_s_w_test +; +@llvm_mips_mini_s_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_mini_s_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_mini_s_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_mini_s_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.mini.s.d(<2 x i64> %0, i32 14) + store <2 x i64> %1, <2 x i64>* @llvm_mips_mini_s_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.mini.s.d(<2 x i64>, i32) nounwind + +; CHECK: llvm_mips_mini_s_d_test: +; CHECK: ld.d +; CHECK: mini_s.d +; CHECK: st.d +; CHECK: .size llvm_mips_mini_s_d_test +; +@llvm_mips_mini_u_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_mini_u_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_mini_u_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_mini_u_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.mini.u.b(<16 x i8> %0, i32 14) + store <16 x i8> %1, <16 x i8>* @llvm_mips_mini_u_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.mini.u.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_mini_u_b_test: +; CHECK: ld.b +; CHECK: mini_u.b +; CHECK: st.b +; CHECK: .size llvm_mips_mini_u_b_test +; +@llvm_mips_mini_u_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_mini_u_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_mini_u_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_mini_u_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.mini.u.h(<8 x i16> %0, i32 14) + store <8 x i16> %1, <8 x i16>* @llvm_mips_mini_u_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.mini.u.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_mini_u_h_test: +; CHECK: ld.h +; CHECK: mini_u.h +; CHECK: st.h +; CHECK: .size llvm_mips_mini_u_h_test +; +@llvm_mips_mini_u_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_mini_u_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_mini_u_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_mini_u_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.mini.u.w(<4 x i32> %0, i32 14) + store <4 x i32> %1, <4 x i32>* @llvm_mips_mini_u_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.mini.u.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_mini_u_w_test: +; CHECK: ld.w +; CHECK: mini_u.w +; CHECK: st.w +; CHECK: .size llvm_mips_mini_u_w_test +; +@llvm_mips_mini_u_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_mini_u_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_mini_u_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_mini_u_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.mini.u.d(<2 x i64> %0, i32 14) + store <2 x i64> %1, <2 x i64>* @llvm_mips_mini_u_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.mini.u.d(<2 x i64>, i32) nounwind + +; CHECK: llvm_mips_mini_u_d_test: +; CHECK: ld.d +; CHECK: mini_u.d +; CHECK: st.d +; CHECK: .size llvm_mips_mini_u_d_test +; diff --git a/test/CodeGen/Mips/msa/i5-s.ll b/test/CodeGen/Mips/msa/i5-s.ll new file mode 100644 index 0000000..058e0ed --- /dev/null +++ b/test/CodeGen/Mips/msa/i5-s.ll @@ -0,0 +1,78 @@ +; RUN: llc -march=mips -mattr=+msa < %s | FileCheck %s + +@llvm_mips_subvi_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_subvi_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_subvi_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_subvi_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.subvi.b(<16 x i8> %0, i32 14) + store <16 x i8> %1, <16 x i8>* @llvm_mips_subvi_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.subvi.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_subvi_b_test: +; CHECK: ld.b +; CHECK: subvi.b +; CHECK: st.b +; CHECK: .size llvm_mips_subvi_b_test +; +@llvm_mips_subvi_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_subvi_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_subvi_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_subvi_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.subvi.h(<8 x i16> %0, i32 14) + store <8 x i16> %1, <8 x i16>* @llvm_mips_subvi_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.subvi.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_subvi_h_test: +; CHECK: ld.h +; CHECK: subvi.h +; CHECK: st.h +; CHECK: .size llvm_mips_subvi_h_test +; +@llvm_mips_subvi_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_subvi_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_subvi_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_subvi_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.subvi.w(<4 x i32> %0, i32 14) + store <4 x i32> %1, <4 x i32>* @llvm_mips_subvi_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.subvi.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_subvi_w_test: +; CHECK: ld.w +; CHECK: subvi.w +; CHECK: st.w +; CHECK: .size llvm_mips_subvi_w_test +; +@llvm_mips_subvi_d_ARG1 = global <2 x i64> <i64 0, i64 1>, align 16 +@llvm_mips_subvi_d_RES = global <2 x i64> <i64 0, i64 0>, align 16 + +define void @llvm_mips_subvi_d_test() nounwind { +entry: + %0 = load <2 x i64>* @llvm_mips_subvi_d_ARG1 + %1 = tail call <2 x i64> @llvm.mips.subvi.d(<2 x i64> %0, i32 14) + store <2 x i64> %1, <2 x i64>* @llvm_mips_subvi_d_RES + ret void +} + +declare <2 x i64> @llvm.mips.subvi.d(<2 x i64>, i32) nounwind + +; CHECK: llvm_mips_subvi_d_test: +; CHECK: ld.d +; CHECK: subvi.d +; CHECK: st.d +; CHECK: .size llvm_mips_subvi_d_test +; diff --git a/test/CodeGen/Mips/msa/i8.ll b/test/CodeGen/Mips/msa/i8.ll index 4dc30e3..5587848 100644 --- a/test/CodeGen/Mips/msa/i8.ll +++ b/test/CodeGen/Mips/msa/i8.ll @@ -76,3 +76,117 @@ declare <16 x i8> @llvm.mips.bseli.b(<16 x i8>, i32) nounwind ; CHECK: st.b ; CHECK: .size llvm_mips_bseli_b_test ; +@llvm_mips_nori_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_nori_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_nori_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_nori_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.nori.b(<16 x i8> %0, i32 25) + store <16 x i8> %1, <16 x i8>* @llvm_mips_nori_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.nori.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_nori_b_test: +; CHECK: ld.b +; CHECK: nori.b +; CHECK: st.b +; CHECK: .size llvm_mips_nori_b_test +; +@llvm_mips_ori_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_ori_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_ori_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_ori_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.ori.b(<16 x i8> %0, i32 25) + store <16 x i8> %1, <16 x i8>* @llvm_mips_ori_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.ori.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_ori_b_test: +; CHECK: ld.b +; CHECK: ori.b +; CHECK: st.b +; CHECK: .size llvm_mips_ori_b_test +; +@llvm_mips_shf_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_shf_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_shf_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_shf_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.shf.b(<16 x i8> %0, i32 25) + store <16 x i8> %1, <16 x i8>* @llvm_mips_shf_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.shf.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_shf_b_test: +; CHECK: ld.b +; CHECK: shf.b +; CHECK: st.b +; CHECK: .size llvm_mips_shf_b_test +; +@llvm_mips_shf_h_ARG1 = global <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, align 16 +@llvm_mips_shf_h_RES = global <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, align 16 + +define void @llvm_mips_shf_h_test() nounwind { +entry: + %0 = load <8 x i16>* @llvm_mips_shf_h_ARG1 + %1 = tail call <8 x i16> @llvm.mips.shf.h(<8 x i16> %0, i32 25) + store <8 x i16> %1, <8 x i16>* @llvm_mips_shf_h_RES + ret void +} + +declare <8 x i16> @llvm.mips.shf.h(<8 x i16>, i32) nounwind + +; CHECK: llvm_mips_shf_h_test: +; CHECK: ld.h +; CHECK: shf.h +; CHECK: st.h +; CHECK: .size llvm_mips_shf_h_test +; +@llvm_mips_shf_w_ARG1 = global <4 x i32> <i32 0, i32 1, i32 2, i32 3>, align 16 +@llvm_mips_shf_w_RES = global <4 x i32> <i32 0, i32 0, i32 0, i32 0>, align 16 + +define void @llvm_mips_shf_w_test() nounwind { +entry: + %0 = load <4 x i32>* @llvm_mips_shf_w_ARG1 + %1 = tail call <4 x i32> @llvm.mips.shf.w(<4 x i32> %0, i32 25) + store <4 x i32> %1, <4 x i32>* @llvm_mips_shf_w_RES + ret void +} + +declare <4 x i32> @llvm.mips.shf.w(<4 x i32>, i32) nounwind + +; CHECK: llvm_mips_shf_w_test: +; CHECK: ld.w +; CHECK: shf.w +; CHECK: st.w +; CHECK: .size llvm_mips_shf_w_test +; +@llvm_mips_xori_b_ARG1 = global <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, align 16 +@llvm_mips_xori_b_RES = global <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, align 16 + +define void @llvm_mips_xori_b_test() nounwind { +entry: + %0 = load <16 x i8>* @llvm_mips_xori_b_ARG1 + %1 = tail call <16 x i8> @llvm.mips.xori.b(<16 x i8> %0, i32 25) + store <16 x i8> %1, <16 x i8>* @llvm_mips_xori_b_RES + ret void +} + +declare <16 x i8> @llvm.mips.xori.b(<16 x i8>, i32) nounwind + +; CHECK: llvm_mips_xori_b_test: +; CHECK: ld.b +; CHECK: xori.b +; CHECK: st.b +; CHECK: .size llvm_mips_xori_b_test +; |