-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add V extension pseudoinstructions #111
base: main
Are you sure you want to change the base?
Add V extension pseudoinstructions #111
Conversation
Signed-off-by: Afonso Oliveira <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list is incomplete (e.g. vl1r.v
/vl2r.v
/vl4r
/vl8r.v
are missing).
To catch them all, either search for "Pseudoinstruction" in the specification or grep for INSN_ALIAS
in Binutils.
Signed-off-by: Afonso Oliveira <[email protected]>
@cmuellner I added the ones you mentioned, but I couldn't really find many more. |
@cmuellner just a quick ping, is there anything else I should enhance in the PR? |
👀 :) |
src/asm-manual.adoc
Outdated
|vmsgeu.vi vd, va, i, vm | vmsgtu.vi vd, va, i-1, vm | Vector >= Immediate, unsigned| | ||
|vmsge.vv vd, va, vb, vm | vmsle.vv vd, vb, va, vm | Vector >= Vector| | ||
|vmsgeu.vv vd, va, vb, vm | vmsleu.vv vd, vb, va, vm | Vector >= Vector, unsigned | | ||
|vmsge.vx vd, va, x, vm | vmsle.vx vd, x, va, vm | Vector >= scalar| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the not the correct expansion for vmsge.vx
From the spec.
Sequences to synthesize `vmsge{u}.vx` instruction
va >= x, x > minimum
addi t0, x, -1; vmsgt{u}.vx vd, va, t0, vm
unmasked va >= x
pseudoinstruction: vmsge{u}.vx vd, va, x
expansion: vmslt{u}.vx vd, va, x; vmnand.mm vd, vd, vd
masked va >= x, vd != v0
pseudoinstruction: vmsge{u}.vx vd, va, x, v0.t
expansion: vmslt{u}.vx vd, va, x, v0.t; vmxor.mm vd, vd, v0
masked va >= x, vd == v0
pseudoinstruction: vmsge{u}.vx vd, va, x, v0.t, vt
expansion: vmslt{u}.vx vt, va, x; vmandn.mm vd, vd, vt
masked va >= x, any vd
pseudoinstruction: vmsge{u}.vx vd, va, x, v0.t, vt
expansion: vmslt{u}.vx vt, va, x; vmandn.mm vt, v0, vt; vmandn.mm vd, vd,
v0; vmor.mm vd, vt, vd
The vt argument to the pseudoinstruction must name a temporary vector
register that is
not same as vd and which will be clobbered by the pseudoinstruction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix it ASAP, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@topperc How can I define this different implementations and follow manual style? Shall I just do a * like in li?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 3 different pseudoinstructions there that should each have their own row
vmsge{u}.vx vd, va, x
vmsge{u}.vx vd, va, x, v0.t // add a note in the last column that vd can't be v0
vmsge{u}.vx vd, va, x, v0.t, vt // you can write the 4 instruction expansion and a note that 2 instructions aren't needed if vd==v0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@topperc In the last commit I kept it exactly as described in the ISA Manual because I feel the 1:1 mapping is easier to understand, is this ok?
Signed-off-by: Afonso Oliveira <[email protected]>
|vl4r.v v4,x0 | vl4re8.v v4, x0 | Equal to vl4re8.v | | ||
|vl8r.v v8,x0 | vl8re8.v v8, x0 | Equal to vl8re8.v | | ||
|
||
|vmsge{u}.vx vd, va, x| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This form isn't implemented in the assembler because it's impossible to know if x>minimum
without doing more analysis than an assembler is capable of.
Closes #110 .
Preview: riscv-asm.pdf