[aarch64-port-dev ] Notations and reliability
Andrew Haley
aph at redhat.com
Tue Mar 28 09:16:10 UTC 2017
We've come a cropper a couple of times because of poorly-chosen
notations. Several times we've had a confusion between iRegI and
iRegINoSp, which causes very obscure crashes. Also, a little while
ago I found several bugs (all mine) caused by getting mixed up between
e.g. strw and str.
I now believe that I made a mistake when I assumed that Xwords
(i.e. 64 bits) were in some way the "default" size on AArch64 and
omitted the X suffix on them. In hindsight, it is much better for
every operation to have a size associated with it, so the programmer
would be forced to choose which one to use, and state it explicitly.
This is how the "standard" assembly language works, and it is better
than what we do.
[Interestingly, the Oracle-authored AArch64 port made exactly the
same (poor, IMO) choice. Perhaps programmers' brains are isomorphic.]
With regard to register classes, GCC uses "GENERAL_REGS" as the name
of the register class that can be allocated as a general-purpose
operands, with "ALL_REGS" for everything. It would be better we did
something similar.
Andrew.
More information about the aarch64-port-dev
mailing list