[PATCH] D96394: [AVR] Improve inline assembly

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 04:29:01 PST 2021


aykevl added a comment.

Oh, now I understand. Apparently there is a `%A0`/`%B0` syntax that I've never seen before in any documentation with which you can select parts of a register.
Yes, this looks good to me, although perhaps @dylanmckay should also take a look?

Can you maybe add a link to this documentation somewhere?
https://www.nongnu.org/avr-libc/user-manual/inline_asm.html



================
Comment at: llvm/lib/Target/AVR/AVRRegisterInfo.td:174
 
+// Lower 16-bit pair registers in R0..R15
+def DREGSlo : RegisterClass<"AVR", [i16], 8,
----------------
Perhaps it's a good idea to add a comment saying this is only for inline assembly?


================
Comment at: llvm/lib/Target/AVR/AVRRegisterInfo.td:177
+  (
+    add R15R14, R13R12, R11R10, R9R8, R7R6, R5R4, R3R2, R1R0
+  )>;
----------------
It seems to me this register class is not limited to these registers: R14R13 should also be included for example.


================
Comment at: llvm/lib/Target/AVR/AVRRegisterInfo.td:184-186
+    add R19R18, R21R20, R23R22,
+    // Callee saved registers.
+    R17R16
----------------
Same here, other pairs are also possible.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96394/new/

https://reviews.llvm.org/D96394



More information about the llvm-commits mailing list