[PATCH] D141752: [AVR] Fix an issue of writing 16-bit ports

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 03:29:45 PST 2023


benshi001 marked an inline comment as done.
benshi001 added a comment.

In D141752#4065457 <https://reviews.llvm.org/D141752#4065457>, @aykevl wrote:

> This works for the `out` instruction, but what about a regular volatile store? I think it should be changed in the same way.

I have did for both `OUTW` and `STSWKRr`. Thanks!



================
Comment at: llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp:1273
 
-  // 16 bit I/O writes need the high byte first
-  auto MIBHI = buildMI(MBB, MBBI, OpHi)
-                   .addImm(Imm + 1)
-                   .addReg(SrcHiReg, getKillRegState(SrcIsKill));
+  unsigned ELFArch = STI.getELFArch();
+  bool XMega =
----------------
aykevl wrote:
> I think this is usually done via subtarget flags, not by looking at e_flags. I couldn't easily find something similar in other targets. But this also works.
I have added a new target feature `FeatureLowByteFirst` and all XMEGA families contains this new feature.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141752



More information about the llvm-commits mailing list