Skip to content

Deriving the operand types of instructions automatically? #524

Answered by Timmmm
moste00 asked this question in Q&A
Discussion options

You must be logged in to vote

You mean you want to somehow distinguish between the bits(12) in

union clause ast = STORE : (bits(12), regidx, regidx, word_width, bool, bool)

and

union clause ast = ADDIW : (bits(12), regidx, regidx)

?

Yeah I don't think that's possible from the Sail types. I'm not sure why you'd need that for a disassembler either? They're disassembled in the same way. Neither of those are a memory address anyway - the STORE immediate is an offset.

only LOADs and STOREs use addresses, everyone else use bits as literals

I think this is probably true; at least I can't think of any counter-examples.

If you wanted to get extremely fancy you could follow the flow of information in the execute clause to s…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by moste00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants