Replies: 1 comment
-
|
We already support transformation functions in the assembly grammar. But different to your example we have to use angle brackets as the parentheses are used for grouping. Your example has to be written as: And we had to add some hacks in the scanner to handle the angle brackets correctly (especially if nested). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The VADL specification defines instruction in the binary representation. For the compiler and parser, we have to use decoding functions (e.g field access functions) to access the "true" value of a field. The inverse of that is the encoding function.
However, we are lacking functions for the assembly representation because sometimes it is possible that the assembly representation of an instruction is different than the value in the underlying MCInst.
For example
lui t0, 1 # t0 = 1 << 12 = 0x1000 = 4096. Here the immediate operand in the assembly has1while the internal value is4096.Until the PR #361, we used the decoding functions for the binary representation (field access function) to handle these cases. If you defined in your assembly grammar the field name as an operand, then we automatically used the decoding function for this field to convert the value. But with the support of field access functions with multiple fields, this approach is quite hard because we don't the field values in the assembly. Additionally, it might be the case that the assembly representation is different the representation in the binary encoding. Those cases are not supported right now.
Therefore, I propose to remove the support for fields in the assembly parser grammar. It is only allowed to define the instruction's operands.
And I propose to extend the syntax with a new function to decode an assembly immediate operand.
Beta Was this translation helpful? Give feedback.
All reactions