Parse mappings from the intermediate representation #827
-
Dear reader, We are currently working on a Sail-to-Rust compiler and I have a question regarding mappings. Is there the possibility to extract the value of mappings from the libsail.Ast type? I have reviewed the documentation but I didn't manage to find the relevant information Libsail.Ast Documentation. Thank you in advance for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I'm not 100% sure what you mean by the 'value' of mappings, perhaps you could clarify what you intend to do with the mappings? In general a mapping is just a way to specify a pair of functions simultaneously. They are elaborated into a forwards and backwards function pretty quickly internally, so most of our backends will just generate a |
Beta Was this translation helpful? Give feedback.
-
By 'value' of mapping, I mean for example the concrete binary representation of MRET but indeed I see that the encdec function gets translated with a endec_backwards, which solves my issue. Thanks for the answer! |
Beta Was this translation helpful? Give feedback.
I'm not 100% sure what you mean by the 'value' of mappings, perhaps you could clarify what you intend to do with the mappings?
In general a mapping is just a way to specify a pair of functions simultaneously. They are elaborated into a forwards and backwards function pretty quickly internally, so most of our backends will just generate a
M_forwards
andM_backwards
function for any mappingM
.