You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
Add an instruction that queries the "mask state" of vector registers. The instruction should take one or two vector registers as source operands and a scalar register as the destination operand. For each register, the mask state can be one of:
All bits in all elements are cleared.
All bits in all elements are set.
At least one bit is set and at least one bit is cleared.
The mask state will be returned as a 32-bit value as follows:
All bits cleared: 0x00000000 (zero)
All bits set: 0xFFFFFFFF (-1)
Mixed set/cleared: 0x00000001 (+1)
That way it's natural to use the same classes of branch instructions that you would use for packed operations, for instance.
When using two different registers as source operands, the resulting state will be the combination of the two states, as if the two registers were concatenated (e.g. 0x00000000 will only be returned if both registers have all bits cleared).
In hardware the instruction can either be implemented as an ALU operation that checks the content of all vector elements, or as a state in the register file that is updated at each write to the vector register file (the latter requires slightly more hardware, but would save CPU cycles).
In a future extension, the state could be possible to query directly with branch instructions (using a vector register as the branch condition). Since it's slightly more complex to implement in hardware, let's not mandate it yet.
Another possible extension would be to allow the source operands to be both vectors and scalars, though the value would probably be limited (essentially it only provides a convenient way to convert "the registers contain mixed bits" to "+1").
The text was updated successfully, but these errors were encountered:
mbitsnbites
changed the title
Add a "mask" for each vector register
Add a "get mask" instruction for vector registers
Jul 23, 2018
Open question: should the mask state be based on the current VL (good fit for an ALU implementation), or the register length (good fit for a register state implementation)?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add an instruction that queries the "mask state" of vector registers. The instruction should take one or two vector registers as source operands and a scalar register as the destination operand. For each register, the mask state can be one of:
The mask state will be returned as a 32-bit value as follows:
That way it's natural to use the same classes of branch instructions that you would use for packed operations, for instance.
When using two different registers as source operands, the resulting state will be the combination of the two states, as if the two registers were concatenated (e.g. 0x00000000 will only be returned if both registers have all bits cleared).
In hardware the instruction can either be implemented as an ALU operation that checks the content of all vector elements, or as a state in the register file that is updated at each write to the vector register file (the latter requires slightly more hardware, but would save CPU cycles).
In a future extension, the state could be possible to query directly with branch instructions (using a vector register as the branch condition). Since it's slightly more complex to implement in hardware, let's not mandate it yet.
Another possible extension would be to allow the source operands to be both vectors and scalars, though the value would probably be limited (essentially it only provides a convenient way to convert "the registers contain mixed bits" to "+1").
The text was updated successfully, but these errors were encountered: