riscv-v-spec icon indicating copy to clipboard operation
riscv-v-spec copied to clipboard

Does use of vstart values greater that the largest element index apply to vle16ff.v?

Open jrahmeh opened this issue 2 years ago • 3 comments
trafficstars

What happens if a vector load fault first instruction (e.g. vle16ff.v) is executed with vstart larger than the largest element index?

Section 3.7 says:

The use of vstart values greater than the largest element index for the current SEW setting is reserved.

This seems unconditional. It should apply to all instructions.

Section 7.7 says:

If an element > 0 raises an exception, the corresponding trap is not taken, and the vector length vl is reduced to the index of the element that would have raised an exception.

Does this statement apply to an element index that is out of bounds (larger than the largest element index)? In this case the element is not raising an exception, the instruction itself is raising an exception because vstart is out of bounds.

jrahmeh avatar Apr 02 '23 18:04 jrahmeh

Does this statement apply to an element index that is out of bounds (larger than the largest element index)? In this case the element is not raising an exception, the instruction itself is raising an exception because vstart is out of bounds.

I don't think this statement apply to that scenario. There is no need to update VL if no destination elements are updated. Maybe changing the wording an element > 0 raises an exception to a body element > 0 raises an exception would be clearer.

furuame avatar Apr 03 '23 01:04 furuame

The spec recommends taking a trap for vstart value greater than largest element index. Do we take a trap for vle16.ff.v?

jrahmeh avatar Apr 03 '23 13:04 jrahmeh

For the rule of vstart value greater than largest element index, I think it applies to all vector instructions in general including fault-only-first instructions.

furuame avatar Apr 03 '23 14:04 furuame