Conversation
relokin
left a comment
There was a problem hiding this comment.
Thanks for this! I've got two comments.
bee0f84 to
4ed8415
Compare
c700f36 to
cca2846
Compare
cca2846 to
650ba79
Compare
650ba79 to
4526d7e
Compare
7fe70c9 to
0c7e519
Compare
b81e8b2 to
cb76a56
Compare
There was a problem hiding this comment.
@HadrienRenaud can I please ask your opinion on the changes to this file?
There was a problem hiding this comment.
I am happy with the file as it is now.
relokin
left a comment
There was a problem hiding this comment.
I am not sure we will retain backwards compatibility, but I think diyone7 will need to support the new instructions. This means we need the annotations PaL -> STLP and PaA -> LDAP. Now I think we can either keep interpreting PaI as either LDIAPP or STILP or we can split that to PaIQ and PaIL. Not that right now I can't generate a test with STILP. Neither this works:
$> diyone7 -metadata false -arch AArch64 PodWW PaIL Rfe PodRR Fre
nor this:
$> diyone7 -metadata false -arch AArch64 PodWW PaI Rfe PodRR Fre
and indeed neither annotation is valid
$> diyone7 -arch AArch64 -show annotations
P X XL XA XAL L Q A PaL PaA PaIQ PaN Pa
|
|
||
| type temporal = TT | NT | ||
| type pair_opt = Pa | PaN | PaI | ||
| type pair_opt = [`Pa | `PaN | `PaIQ | `PaIL | `PaA | `PaL] |
There was a problem hiding this comment.
I don't think we should keep this type
There was a problem hiding this comment.
- I've kept
pair_optbecause having separateLd_PairandSt_Paircaused assertion failures in bothadd_lxm_atomandadd_lxm_edgeas the pretty-printers for shared variants like Pa and PaN produce identical strings, butcompare_atomosees them as different constructors. - Using prefixes (LdPa/StPa) breaks backward compatibility with diyone7 and user-facing tests.
- The unified
Pairat the was the only approach that preserved backward compatibility while avoiding these issues, and this needs thepair_opttype. The split intold_pair_opt/st_pair_optis preserved at the instruction level (I_LDP/I_STP) where direction is known, withpair_opt_to_ldandpair_opt_to_stconversion functions used inemit_accesswhere the direction is relevant again.
| type ld_pair_opt = [`Pa | `PaN | `PaIQ | `PaA] | ||
| type st_pair_opt = [`Pa | `PaN | `PaIL | `PaL] |
There was a problem hiding this comment.
why are we turning this into a Polymorphic type?
There was a problem hiding this comment.
I used polymorphic variants so that ld_pair_opt and st_pair_opt could share common tags (Pa, PaN) while having separate type constraints on I_LDP vs I_STP.
With regular variants, the shared constructors (Pa, PaN) would need to be duplicated across both types (e.g. LdPa/StPa, LdPaN/StPaN), and every conversion and pattern match becomes more verbose. If regular variants are preferred, it's a straightforward change. Happy to switch if there's a preference.
| @@ -477,13 +477,24 @@ let is_tthm fields = | |||
| | Some Capability -> "c" | |||
|
|
|||
| let pp_pair_opt = function | |||
There was a problem hiding this comment.
shouldn't we also split this to a ld and st variant?
There was a problem hiding this comment.
Currently atom_acc uses the Pair of pair_opt * pair_idx.
At the instruction level, the pretty-printing of I_LDP/I_STP doesn't go through pp_pair_opt and it uses the instruction printer directly. So there's no need for split pp_ld_pair_opt/pp_st_pair_opt functions.
If we were to remove the unified pair_opt and go back to Ld_Pair/St_Pair in atom_acc, we cpould split printers, but then we'd hit the add_lxm_atom and add_lxm_edge assertion failures described above since both would produce the same strings for shared variants like Pa and PaN.
|
@ShaleXIONG can you please review and help with the changes to |
This I think is because of a bug in my PR, I failed to include "PaIL" in Here is a working example after I fixed it locally: And here is one with STLP: |
Split pair_opt to load and store types to allow load and store specific annotations to be added.
cb76a56 to
e39f66f
Compare
7e47f91 to
15646ab
Compare
No description provided.