xref: /llvm-project/llvm/test/CodeGen/RISCV/rvv/vsha2ms.ll (revision 09058654f68dd4cc5435f49502de33bac2b7f8fa)
1346c1f26S4vtomat; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2*09058654SEric Biggers; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v,+zvknha,+zvknhb \
3346c1f26S4vtomat; RUN:   -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
4*09058654SEric Biggers; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v,+zvknha,+zvknhb \
5346c1f26S4vtomat; RUN:   -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
6*09058654SEric Biggers; RUN: sed 's/iXLen/i32/g' %s | not --crash llc -mtriple=riscv32 -mattr=+v,+zvknha 2>&1 \
765dc96c2SBrandon Wu; RUN:   | FileCheck --check-prefixes=CHECK-ERROR %s
8*09058654SEric Biggers; RUN: sed 's/iXLen/i64/g' %s | not --crash llc -mtriple=riscv64 -mattr=+v,+zvknha 2>&1 \
965dc96c2SBrandon Wu; RUN:   | FileCheck --check-prefixes=CHECK-ERROR %s
1065dc96c2SBrandon Wu
1165dc96c2SBrandon Wu; CHECK-ERROR: LLVM ERROR: SEW=64 needs Zvknhb to be enabled.
12346c1f26S4vtomat
13346c1f26S4vtomatdeclare <vscale x 4 x i32> @llvm.riscv.vsha2ms.nxv4i32.nxv4i32(
14346c1f26S4vtomat  <vscale x 4 x i32>,
15346c1f26S4vtomat  <vscale x 4 x i32>,
16346c1f26S4vtomat  <vscale x 4 x i32>,
17346c1f26S4vtomat  iXLen,
18346c1f26S4vtomat  iXLen)
19346c1f26S4vtomat
20346c1f26S4vtomatdefine <vscale x 4 x i32> @intrinsic_vsha2ms_vv_nxv4i32_nxv4i32(<vscale x 4 x i32> %0, <vscale x 4 x i32> %1, <vscale x 4 x i32> %2, iXLen %3) nounwind {
21346c1f26S4vtomat; CHECK-LABEL: intrinsic_vsha2ms_vv_nxv4i32_nxv4i32:
22346c1f26S4vtomat; CHECK:       # %bb.0: # %entry
23346c1f26S4vtomat; CHECK-NEXT:    vsetvli zero, a0, e32, m2, tu, ma
24346c1f26S4vtomat; CHECK-NEXT:    vsha2ms.vv v8, v10, v12
25346c1f26S4vtomat; CHECK-NEXT:    ret
26346c1f26S4vtomatentry:
27346c1f26S4vtomat  %a = call <vscale x 4 x i32> @llvm.riscv.vsha2ms.nxv4i32.nxv4i32(
28346c1f26S4vtomat    <vscale x 4 x i32> %0,
29346c1f26S4vtomat    <vscale x 4 x i32> %1,
30346c1f26S4vtomat    <vscale x 4 x i32> %2,
31346c1f26S4vtomat    iXLen %3,
32346c1f26S4vtomat    iXLen 2)
33346c1f26S4vtomat
34346c1f26S4vtomat  ret <vscale x 4 x i32> %a
35346c1f26S4vtomat}
36346c1f26S4vtomat
37346c1f26S4vtomatdeclare <vscale x 8 x i32> @llvm.riscv.vsha2ms.nxv8i32.nxv8i32(
38346c1f26S4vtomat  <vscale x 8 x i32>,
39346c1f26S4vtomat  <vscale x 8 x i32>,
40346c1f26S4vtomat  <vscale x 8 x i32>,
41346c1f26S4vtomat  iXLen,
42346c1f26S4vtomat  iXLen)
43346c1f26S4vtomat
44346c1f26S4vtomatdefine <vscale x 8 x i32> @intrinsic_vsha2ms_vv_nxv8i32_nxv8i32(<vscale x 8 x i32> %0, <vscale x 8 x i32> %1, <vscale x 8 x i32> %2, iXLen %3) nounwind {
45346c1f26S4vtomat; CHECK-LABEL: intrinsic_vsha2ms_vv_nxv8i32_nxv8i32:
46346c1f26S4vtomat; CHECK:       # %bb.0: # %entry
47346c1f26S4vtomat; CHECK-NEXT:    vsetvli zero, a0, e32, m4, tu, ma
48346c1f26S4vtomat; CHECK-NEXT:    vsha2ms.vv v8, v12, v16
49346c1f26S4vtomat; CHECK-NEXT:    ret
50346c1f26S4vtomatentry:
51346c1f26S4vtomat  %a = call <vscale x 8 x i32> @llvm.riscv.vsha2ms.nxv8i32.nxv8i32(
52346c1f26S4vtomat    <vscale x 8 x i32> %0,
53346c1f26S4vtomat    <vscale x 8 x i32> %1,
54346c1f26S4vtomat    <vscale x 8 x i32> %2,
55346c1f26S4vtomat    iXLen %3,
56346c1f26S4vtomat    iXLen 2)
57346c1f26S4vtomat
58346c1f26S4vtomat  ret <vscale x 8 x i32> %a
59346c1f26S4vtomat}
60346c1f26S4vtomat
61346c1f26S4vtomatdeclare <vscale x 16 x i32> @llvm.riscv.vsha2ms.nxv16i32.nxv16i32(
62346c1f26S4vtomat  <vscale x 16 x i32>,
63346c1f26S4vtomat  <vscale x 16 x i32>,
64346c1f26S4vtomat  <vscale x 16 x i32>,
65346c1f26S4vtomat  iXLen,
66346c1f26S4vtomat  iXLen)
67346c1f26S4vtomat
68346c1f26S4vtomatdefine <vscale x 16 x i32> @intrinsic_vsha2ms_vv_nxv16i32_nxv16i32(<vscale x 16 x i32> %0, <vscale x 16 x i32> %1, <vscale x 16 x i32> %2, iXLen %3) nounwind {
69346c1f26S4vtomat; CHECK-LABEL: intrinsic_vsha2ms_vv_nxv16i32_nxv16i32:
70346c1f26S4vtomat; CHECK:       # %bb.0: # %entry
71346c1f26S4vtomat; CHECK-NEXT:    vl8re32.v v24, (a0)
72346c1f26S4vtomat; CHECK-NEXT:    vsetvli zero, a1, e32, m8, tu, ma
73346c1f26S4vtomat; CHECK-NEXT:    vsha2ms.vv v8, v16, v24
74346c1f26S4vtomat; CHECK-NEXT:    ret
75346c1f26S4vtomatentry:
76346c1f26S4vtomat  %a = call <vscale x 16 x i32> @llvm.riscv.vsha2ms.nxv16i32.nxv16i32(
77346c1f26S4vtomat    <vscale x 16 x i32> %0,
78346c1f26S4vtomat    <vscale x 16 x i32> %1,
79346c1f26S4vtomat    <vscale x 16 x i32> %2,
80346c1f26S4vtomat    iXLen %3,
81346c1f26S4vtomat    iXLen 2)
82346c1f26S4vtomat
83346c1f26S4vtomat  ret <vscale x 16 x i32> %a
84346c1f26S4vtomat}
85346c1f26S4vtomat
86346c1f26S4vtomatdeclare <vscale x 4 x i64> @llvm.riscv.vsha2ms.nxv4i64.nxv4i64(
87346c1f26S4vtomat  <vscale x 4 x i64>,
88346c1f26S4vtomat  <vscale x 4 x i64>,
89346c1f26S4vtomat  <vscale x 4 x i64>,
90346c1f26S4vtomat  iXLen,
91346c1f26S4vtomat  iXLen)
92346c1f26S4vtomat
93346c1f26S4vtomatdefine <vscale x 4 x i64> @intrinsic_vsha2ms_vv_nxv4i64_nxv4i64(<vscale x 4 x i64> %0, <vscale x 4 x i64> %1, <vscale x 4 x i64> %2, iXLen %3) nounwind {
94346c1f26S4vtomat; CHECK-LABEL: intrinsic_vsha2ms_vv_nxv4i64_nxv4i64:
95346c1f26S4vtomat; CHECK:       # %bb.0: # %entry
96346c1f26S4vtomat; CHECK-NEXT:    vsetvli zero, a0, e64, m4, tu, ma
97346c1f26S4vtomat; CHECK-NEXT:    vsha2ms.vv v8, v12, v16
98346c1f26S4vtomat; CHECK-NEXT:    ret
99346c1f26S4vtomatentry:
100346c1f26S4vtomat  %a = call <vscale x 4 x i64> @llvm.riscv.vsha2ms.nxv4i64.nxv4i64(
101346c1f26S4vtomat    <vscale x 4 x i64> %0,
102346c1f26S4vtomat    <vscale x 4 x i64> %1,
103346c1f26S4vtomat    <vscale x 4 x i64> %2,
104346c1f26S4vtomat    iXLen %3,
105346c1f26S4vtomat    iXLen 2)
106346c1f26S4vtomat
107346c1f26S4vtomat  ret <vscale x 4 x i64> %a
108346c1f26S4vtomat}
109346c1f26S4vtomat
110346c1f26S4vtomatdeclare <vscale x 8 x i64> @llvm.riscv.vsha2ms.nxv8i64.nxv8i64(
111346c1f26S4vtomat  <vscale x 8 x i64>,
112346c1f26S4vtomat  <vscale x 8 x i64>,
113346c1f26S4vtomat  <vscale x 8 x i64>,
114346c1f26S4vtomat  iXLen,
115346c1f26S4vtomat  iXLen)
116346c1f26S4vtomat
117346c1f26S4vtomatdefine <vscale x 8 x i64> @intrinsic_vsha2ms_vv_nxv8i64_nxv8i64(<vscale x 8 x i64> %0, <vscale x 8 x i64> %1, <vscale x 8 x i64> %2, iXLen %3) nounwind {
118346c1f26S4vtomat; CHECK-LABEL: intrinsic_vsha2ms_vv_nxv8i64_nxv8i64:
119346c1f26S4vtomat; CHECK:       # %bb.0: # %entry
120346c1f26S4vtomat; CHECK-NEXT:    vl8re64.v v24, (a0)
121346c1f26S4vtomat; CHECK-NEXT:    vsetvli zero, a1, e64, m8, tu, ma
122346c1f26S4vtomat; CHECK-NEXT:    vsha2ms.vv v8, v16, v24
123346c1f26S4vtomat; CHECK-NEXT:    ret
124346c1f26S4vtomatentry:
125346c1f26S4vtomat  %a = call <vscale x 8 x i64> @llvm.riscv.vsha2ms.nxv8i64.nxv8i64(
126346c1f26S4vtomat    <vscale x 8 x i64> %0,
127346c1f26S4vtomat    <vscale x 8 x i64> %1,
128346c1f26S4vtomat    <vscale x 8 x i64> %2,
129346c1f26S4vtomat    iXLen %3,
130346c1f26S4vtomat    iXLen 2)
131346c1f26S4vtomat
132346c1f26S4vtomat  ret <vscale x 8 x i64> %a
133346c1f26S4vtomat}
134