[riscv] Save vector registers when entering the runtime [v8/v8 : main]

0 views
Skip to first unread message

Yahan Lu (LuYahan) (Gerrit)

unread,
Sep 4, 2025, 1:14:07 AM (3 days ago) Sep 4
to Florian Loitsch, Ji Qiu, Kasper Lund, v8-re...@googlegroups.com
Attention needed from Florian Loitsch, Ji Qiu and Kasper Lund

Yahan Lu (LuYahan) added 1 comment

File src/builtins/riscv/builtins-riscv.cc
Line 3050, Patchset 4 (Latest): SaveVectorRegisters(masm, kSavedVectorRegs);
Yahan Lu (LuYahan) . unresolved

Should check enable RVV extension ?

Open in Gerrit

Related details

Attention is currently required from:
  • Florian Loitsch
  • Ji Qiu
  • Kasper Lund
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ief1fe0486a1ee7066ce7cc64a16055b2e7967c80
Gerrit-Change-Number: 6842160
Gerrit-PatchSet: 4
Gerrit-Owner: Florian Loitsch <floi...@rivosinc.com>
Gerrit-Reviewer: Ji Qiu <qi...@iscas.ac.cn>
Gerrit-Reviewer: Kasper Lund <kas...@rivosinc.com>
Gerrit-Reviewer: Yahan Lu (LuYahan) <ya...@iscas.ac.cn>
Gerrit-Attention: Kasper Lund <kas...@rivosinc.com>
Gerrit-Attention: Ji Qiu <qi...@iscas.ac.cn>
Gerrit-Attention: Florian Loitsch <floi...@rivosinc.com>
Gerrit-Comment-Date: Thu, 04 Sep 2025 05:14:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Florian Loitsch (Gerrit)

unread,
Sep 4, 2025, 2:57:27 AM (3 days ago) Sep 4
to Ji Qiu, Yahan Lu (LuYahan), Kasper Lund, v8-re...@googlegroups.com
Attention needed from Ji Qiu, Kasper Lund and Yahan Lu (LuYahan)

Florian Loitsch added 1 comment

File src/builtins/riscv/builtins-riscv.cc
Line 3050, Patchset 4 (Latest): SaveVectorRegisters(masm, kSavedVectorRegs);
Yahan Lu (LuYahan) . unresolved

Should check enable RVV extension ?

Florian Loitsch

See the TODO in line 3020 and 3033.
I haven't yet figured out how to test for the RVV extension in code that is built as part of the snapshot.

Open in Gerrit

Related details

Attention is currently required from:
  • Ji Qiu
  • Kasper Lund
  • Yahan Lu (LuYahan)
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ief1fe0486a1ee7066ce7cc64a16055b2e7967c80
Gerrit-Change-Number: 6842160
Gerrit-PatchSet: 4
Gerrit-Owner: Florian Loitsch <floi...@rivosinc.com>
Gerrit-Reviewer: Ji Qiu <qi...@iscas.ac.cn>
Gerrit-Reviewer: Kasper Lund <kas...@rivosinc.com>
Gerrit-Reviewer: Yahan Lu (LuYahan) <ya...@iscas.ac.cn>
Gerrit-Attention: Kasper Lund <kas...@rivosinc.com>
Gerrit-Attention: Yahan Lu (LuYahan) <ya...@iscas.ac.cn>
Gerrit-Attention: Ji Qiu <qi...@iscas.ac.cn>
Gerrit-Comment-Date: Thu, 04 Sep 2025 06:57:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Yahan Lu (LuYahan) <ya...@iscas.ac.cn>
unsatisfied_requirement
open
diffy

Yahan Lu (LuYahan) (Gerrit)

unread,
Sep 4, 2025, 11:29:07 PM (2 days ago) Sep 4
to Florian Loitsch, Ji Qiu, Kasper Lund, v8-re...@googlegroups.com
Attention needed from Florian Loitsch, Ji Qiu and Kasper Lund

Yahan Lu (LuYahan) added 1 comment

File src/builtins/riscv/builtins-riscv.cc
Line 3050, Patchset 4 (Latest): SaveVectorRegisters(masm, kSavedVectorRegs);
Yahan Lu (LuYahan) . unresolved

Should check enable RVV extension ?

Florian Loitsch

See the TODO in line 3020 and 3033.
I haven't yet figured out how to test for the RVV extension in code that is built as part of the snapshot.

Yahan Lu (LuYahan)

If don't check, v8 will segment fault on hardware without Vector. Can we read CSR register to check?

Open in Gerrit

Related details

Attention is currently required from:
  • Florian Loitsch
  • Ji Qiu
  • Kasper Lund
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ief1fe0486a1ee7066ce7cc64a16055b2e7967c80
Gerrit-Change-Number: 6842160
Gerrit-PatchSet: 4
Gerrit-Owner: Florian Loitsch <floi...@rivosinc.com>
Gerrit-Reviewer: Ji Qiu <qi...@iscas.ac.cn>
Gerrit-Reviewer: Kasper Lund <kas...@rivosinc.com>
Gerrit-Reviewer: Yahan Lu (LuYahan) <ya...@iscas.ac.cn>
Gerrit-Attention: Kasper Lund <kas...@rivosinc.com>
Gerrit-Attention: Ji Qiu <qi...@iscas.ac.cn>
Gerrit-Attention: Florian Loitsch <floi...@rivosinc.com>
Gerrit-Comment-Date: Fri, 05 Sep 2025 03:29:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Yahan Lu (LuYahan) <ya...@iscas.ac.cn>
Comment-In-Reply-To: Florian Loitsch <floi...@rivosinc.com>
unsatisfied_requirement
open
diffy

Yahan Lu (LuYahan) (Gerrit)

unread,
Sep 5, 2025, 1:54:56 AM (2 days ago) Sep 5
to Florian Loitsch, Ji Qiu, Kasper Lund, v8-re...@googlegroups.com
Attention needed from Florian Loitsch, Ji Qiu and Kasper Lund

Yahan Lu (LuYahan) added 1 comment

File src/builtins/riscv/builtins-riscv.cc
Line 3050, Patchset 4 (Latest): SaveVectorRegisters(masm, kSavedVectorRegs);
Yahan Lu (LuYahan) . unresolved

Should check enable RVV extension ?

Florian Loitsch

See the TODO in line 3020 and 3033.
I haven't yet figured out how to test for the RVV extension in code that is built as part of the snapshot.

Yahan Lu (LuYahan)

If don't check, v8 will segment fault on hardware without Vector. Can we read CSR register to check?

Yahan Lu (LuYahan)
And i think there can add 
```suggestion
#ifdefine CAN_USE_RVV
SaveVectorRegisters(masm, kSavedVectorRegs);
#endif
```
The cpu.cc can't check RVV extension for now.
Gerrit-Comment-Date: Fri, 05 Sep 2025 05:54:52 +0000
unsatisfied_requirement
open
diffy

Florian Loitsch (Gerrit)

unread,
Sep 5, 2025, 4:00:10 AM (2 days ago) Sep 5
to Ji Qiu, Yahan Lu (LuYahan), Kasper Lund, v8-re...@googlegroups.com
Attention needed from Kasper Lund and Yahan Lu (LuYahan)

Florian Loitsch added 1 comment

File src/builtins/riscv/builtins-riscv.cc
Line 3050, Patchset 4 (Latest): SaveVectorRegisters(masm, kSavedVectorRegs);
Yahan Lu (LuYahan) . unresolved

Should check enable RVV extension ?

Florian Loitsch

See the TODO in line 3020 and 3033.
I haven't yet figured out how to test for the RVV extension in code that is built as part of the snapshot.

Yahan Lu (LuYahan)

If don't check, v8 will segment fault on hardware without Vector. Can we read CSR register to check?

Yahan Lu (LuYahan)
And i think there can add 
```suggestion
#ifdefine CAN_USE_RVV
SaveVectorRegisters(masm, kSavedVectorRegs);
#endif
```
The cpu.cc can't check RVV extension for now.
Florian Loitsch

The SIGILL (when vectors aren't present), was the reason I hadn't added any reviewers yet. I probably should have marked it as work-in-progress. (Done now).

CAN_USE_RVV_INSTRUCTIONS isn't really used anymore, except in the simulator.
All other places (except one that I will fix) use feature-detection.

Open in Gerrit

Related details

Attention is currently required from:
  • Kasper Lund
  • Yahan Lu (LuYahan)
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ief1fe0486a1ee7066ce7cc64a16055b2e7967c80
Gerrit-Change-Number: 6842160
Gerrit-PatchSet: 4
Gerrit-Owner: Florian Loitsch <floi...@rivosinc.com>
Gerrit-Reviewer: Ji Qiu <qi...@iscas.ac.cn>
Gerrit-Reviewer: Kasper Lund <kas...@rivosinc.com>
Gerrit-Reviewer: Yahan Lu (LuYahan) <ya...@iscas.ac.cn>
Gerrit-Attention: Kasper Lund <kas...@rivosinc.com>
Gerrit-Attention: Yahan Lu (LuYahan) <ya...@iscas.ac.cn>
Gerrit-Comment-Date: Fri, 05 Sep 2025 08:00:05 +0000
unsatisfied_requirement
open
diffy

Florian Loitsch (Gerrit)

unread,
Sep 5, 2025, 8:08:13 AM (2 days ago) Sep 5
to Ji Qiu, Yahan Lu (LuYahan), Kasper Lund, v8-re...@googlegroups.com
Attention needed from Ji Qiu, Kasper Lund and Yahan Lu (LuYahan)

Florian Loitsch added 1 comment

File src/builtins/riscv/builtins-riscv.cc
Line 3050, Patchset 4: SaveVectorRegisters(masm, kSavedVectorRegs);
Yahan Lu (LuYahan) . resolved

Should check enable RVV extension ?

Florian Loitsch

See the TODO in line 3020 and 3033.
I haven't yet figured out how to test for the RVV extension in code that is built as part of the snapshot.

Yahan Lu (LuYahan)

If don't check, v8 will segment fault on hardware without Vector. Can we read CSR register to check?

Yahan Lu (LuYahan)
And i think there can add 
```suggestion
#ifdefine CAN_USE_RVV
SaveVectorRegisters(masm, kSavedVectorRegs);
#endif
```
The cpu.cc can't check RVV extension for now.
Florian Loitsch

The SIGILL (when vectors aren't present), was the reason I hadn't added any reviewers yet. I probably should have marked it as work-in-progress. (Done now).

CAN_USE_RVV_INSTRUCTIONS isn't really used anymore, except in the simulator.
All other places (except one that I will fix) use feature-detection.

Florian Loitsch

I'm now using a reference to the `supports_wasm_simd_128` bool.

Open in Gerrit

Related details

Attention is currently required from:
  • Ji Qiu
  • Kasper Lund
  • Yahan Lu (LuYahan)
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ief1fe0486a1ee7066ce7cc64a16055b2e7967c80
Gerrit-Change-Number: 6842160
Gerrit-PatchSet: 5
Gerrit-Owner: Florian Loitsch <floi...@rivosinc.com>
Gerrit-Reviewer: Ji Qiu <qi...@iscas.ac.cn>
Gerrit-Reviewer: Kasper Lund <kas...@rivosinc.com>
Gerrit-Reviewer: Yahan Lu (LuYahan) <ya...@iscas.ac.cn>
Gerrit-Attention: Kasper Lund <kas...@rivosinc.com>
Gerrit-Attention: Yahan Lu (LuYahan) <ya...@iscas.ac.cn>
Gerrit-Attention: Ji Qiu <qi...@iscas.ac.cn>
Gerrit-Comment-Date: Fri, 05 Sep 2025 12:08:02 +0000
unsatisfied_requirement
open
diffy

Ji Qiu (Gerrit)

unread,
Sep 6, 2025, 6:16:34 AM (yesterday) Sep 6
to Florian Loitsch, Yahan Lu (LuYahan), Kasper Lund, v8-re...@googlegroups.com
Attention needed from Florian Loitsch, Kasper Lund and Yahan Lu (LuYahan)

Ji Qiu voted and added 1 comment

Votes added by Ji Qiu

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Ji Qiu . resolved

This solution seems perfect.

Open in Gerrit

Related details

Attention is currently required from:
  • Florian Loitsch
  • Kasper Lund
  • Yahan Lu (LuYahan)
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ief1fe0486a1ee7066ce7cc64a16055b2e7967c80
    Gerrit-Change-Number: 6842160
    Gerrit-PatchSet: 6
    Gerrit-Owner: Florian Loitsch <floi...@rivosinc.com>
    Gerrit-Reviewer: Ji Qiu <qi...@iscas.ac.cn>
    Gerrit-Reviewer: Kasper Lund <kas...@rivosinc.com>
    Gerrit-Reviewer: Yahan Lu (LuYahan) <ya...@iscas.ac.cn>
    Gerrit-Attention: Kasper Lund <kas...@rivosinc.com>
    Gerrit-Attention: Yahan Lu (LuYahan) <ya...@iscas.ac.cn>
    Gerrit-Attention: Florian Loitsch <floi...@rivosinc.com>
    Gerrit-Comment-Date: Sat, 06 Sep 2025 10:16:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages