Skip to content

Commit cb74be0

Browse files
authored
Merge pull request #1888 from tsewei-lin/vector-crypto-misaligned
vector: crypto: fix constraint checks for vector-crypto instructions
2 parents 615e47d + 7347f43 commit cb74be0

15 files changed

+69
-2
lines changed

riscv/insns/vghsh_vv.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
#include "zvk_ext_macros.h"
44

5+
const uint32_t EGS = 4;
6+
57
require_zvkg;
68
require(P.VU.vsew == 32);
79
require_egw_fits(128);
10+
require(P.VU.vl->read() % EGS == 0);
11+
VI_CHECK_SSS(true)
812

913
VI_ZVK_VD_VS1_VS2_EGU32x4_NOVM_LOOP(
1014
{},

riscv/insns/vgmul_vv.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
#include "zvk_ext_macros.h"
44

5+
const uint32_t EGS = 4;
6+
57
require_zvkg;
68
require(P.VU.vsew == 32);
79
require_egw_fits(128);
10+
require(P.VU.vl->read() % EGS == 0);
11+
VI_CHECK_SSS(false)
812

913
VI_ZVK_VD_VS2_EGU32x4_NOVM_LOOP(
1014
{},

riscv/insns/vsm3c_vi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "zvksh_ext_macros.h"
44

55
require_vsm3_constraints;
6+
VI_CHECK_SSS(false)
67

78
VI_ZVK_VD_VS2_ZIMM5_EGU32x8_NOVM_LOOP(
89
{},

riscv/insns/vsm3me_vv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
(ZVKSH_P1((M16) ^ (M9) ^ ZVK_ROL32((M3), 15)) ^ ZVK_ROL32((M13), 7) ^ (M6))
1414

1515
require_vsm3_constraints;
16+
VI_CHECK_SSS(true)
1617

1718
VI_ZVK_VD_VS1_VS2_EGU32x8_NOVM_LOOP(
1819
{},

riscv/insns/vsm4k_vi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ static constexpr uint32_t zvksed_ck[32] = {
1515
};
1616

1717
require_vsm4_constraints;
18+
VI_CHECK_SSS(false)
1819

1920
VI_ZVK_VD_VS2_ZIMM5_EGU32x4_NOVM_LOOP(
2021
{},

riscv/insns/vsm4r_vs.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
#include "zvksed_ext_macros.h"
44

5+
const uint32_t EGS = 4;
6+
57
require_vsm4_constraints;
8+
require_align(insn.rd(), P.VU.vflmul);
9+
require_vs2_align_eglmul(128);
610
// No overlap of vd and vs2.
7-
require(insn.rd() != insn.rs2());
11+
require_noover_eglmul(insn.rd(), insn.rs2());
812

913
VI_ZVK_VD_VS2_NOOPERANDS_PRELOOP_EGU32x4_NOVM_LOOP(
1014
{},

riscv/insns/vsm4r_vv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
#include "zvksed_ext_macros.h"
44

5+
56
require_vsm4_constraints;
7+
VI_CHECK_SSS(false)
68

79
VI_ZVK_VD_VS2_EGU32x4_NOVM_LOOP(
810
{},

riscv/insns/vwsll_vi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "zvk_ext_macros.h"
44

55
require_zvbb;
6+
VI_CHECK_DSS(false);
67

78
VI_ZVK_VI_WIDENING_ULOOP({
89
const reg_t shift = zimm5 & ((2 * sew) - 1);

riscv/insns/vwsll_vv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "zvk_ext_macros.h"
44

55
require_zvbb;
6+
VI_CHECK_DSS(true);
67

78
VI_ZVK_VV_WIDENING_ULOOP({
89
const reg_t shift = (vs1 & ((2 * sew) - 1));

riscv/insns/vwsll_vx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "zvk_ext_macros.h"
44

55
require_zvbb;
6+
VI_CHECK_DSS(false);
67

78
VI_ZVK_VX_WIDENING_ULOOP({
89
const reg_t shift = (rs1 & ((2 * sew) - 1));

0 commit comments

Comments
 (0)