Commit 2384c941 authored by Lu Yahan's avatar Lu Yahan Committed by V8 LUCI CQ

[riscv64] Check ervey lane in rvv

Change-Id: Ice5b9a09d4c4c1a8013cf5c0993c4ec6111f6c51
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3353070Reviewed-by: 's avatarji qiu <qiuji@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#78435}
parent 741b18f5
...@@ -664,25 +664,6 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { ...@@ -664,25 +664,6 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
return (mask << 7) | (tail << 6) | ((vsew & 0x7) << 3) | (vlmul & 0x7); return (mask << 7) | (tail << 6) | ((vsew & 0x7) << 3) | (vlmul & 0x7);
} }
void vsetvli(Register rd, Register rs1, VSew vsew, Vlmul vlmul,
TailAgnosticType tail = tu, MaskAgnosticType mask = mu);
void vsetivli(Register rd, uint8_t uimm, VSew vsew, Vlmul vlmul,
TailAgnosticType tail = tu, MaskAgnosticType mask = mu);
inline void vsetvlmax(Register rd, VSew vsew, Vlmul vlmul,
TailAgnosticType tail = tu,
MaskAgnosticType mask = mu) {
vsetvli(rd, zero_reg, vsew, vlmul, tu, mu);
}
inline void vsetvl(VSew vsew, Vlmul vlmul, TailAgnosticType tail = tu,
MaskAgnosticType mask = mu) {
vsetvli(zero_reg, zero_reg, vsew, vlmul, tu, mu);
}
void vsetvl(Register rd, Register rs1, Register rs2);
void vl(VRegister vd, Register rs1, uint8_t lumop, VSew vsew, void vl(VRegister vd, Register rs1, uint8_t lumop, VSew vsew,
MaskType mask = NoMask); MaskType mask = NoMask);
void vls(VRegister vd, Register rs1, Register rs2, VSew vsew, void vls(VRegister vd, Register rs1, Register rs2, VSew vsew,
...@@ -1293,6 +1274,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { ...@@ -1293,6 +1274,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
constpool_.RecordEntry(data, rmode); constpool_.RecordEntry(data, rmode);
} }
friend class VectorUnit;
class VectorUnit { class VectorUnit {
public: public:
inline int32_t sew() const { return 2 ^ (sew_ + 3); } inline int32_t sew() const { return 2 ^ (sew_ + 3); }
...@@ -1445,6 +1427,25 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { ...@@ -1445,6 +1427,25 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
bool is_buffer_growth_blocked() const { return block_buffer_growth_; } bool is_buffer_growth_blocked() const { return block_buffer_growth_; }
private: private:
void vsetvli(Register rd, Register rs1, VSew vsew, Vlmul vlmul,
TailAgnosticType tail = tu, MaskAgnosticType mask = mu);
void vsetivli(Register rd, uint8_t uimm, VSew vsew, Vlmul vlmul,
TailAgnosticType tail = tu, MaskAgnosticType mask = mu);
inline void vsetvlmax(Register rd, VSew vsew, Vlmul vlmul,
TailAgnosticType tail = tu,
MaskAgnosticType mask = mu) {
vsetvli(rd, zero_reg, vsew, vlmul, tu, mu);
}
inline void vsetvl(VSew vsew, Vlmul vlmul, TailAgnosticType tail = tu,
MaskAgnosticType mask = mu) {
vsetvli(zero_reg, zero_reg, vsew, vlmul, tu, mu);
}
void vsetvl(Register rd, Register rs1, Register rs2);
// Avoid overflows for displacements etc. // Avoid overflows for displacements etc.
static const int kMaximalBufferSize = 512 * MB; static const int kMaximalBufferSize = 512 * MB;
......
This diff is collapsed.
...@@ -527,10 +527,11 @@ TEST(Previleged) { ...@@ -527,10 +527,11 @@ TEST(Previleged) {
VERIFY_RUN(); VERIFY_RUN();
} }
*/ */
#ifdef CAN_USE_RVV_INSTRUCTIONS
TEST(RVV) { TEST(RVV) {
if (!CpuFeatures::IsSupported(RISCV_SIMD)) return;
SET_UP(); SET_UP();
COMPARE(vsetvlmax(kScratchReg, E64, m1), COMPARE(VU.set(kScratchReg, E64, m1),
"018079d7 vsetvli s3, zero_reg, E64, m1"); "018079d7 vsetvli s3, zero_reg, E64, m1");
COMPARE(vl(v2, a0, 0, VSew::E8), "02050107 vle8.v v2, (a0)"); COMPARE(vl(v2, a0, 0, VSew::E8), "02050107 vle8.v v2, (a0)");
COMPARE(vl(v2, a0, 0, VSew::E8), "02050107 vle8.v v2, (a0)"); COMPARE(vl(v2, a0, 0, VSew::E8), "02050107 vle8.v v2, (a0)");
...@@ -624,6 +625,6 @@ TEST(RVV) { ...@@ -624,6 +625,6 @@ TEST(RVV) {
VERIFY_RUN(); VERIFY_RUN();
} }
#endif
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment