[PATCH] D116493: [AVR] Generate ELPM for loading byte/word from extended program memory
Ben Shi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 2 03:40:03 PST 2022
benshi001 added a comment.
Some key design points,
1. Define four pseudo instructions, ELPMBRdZ/ELPMWRdZ/ELPMBRdZPi/ELPMWRdZPi, which all are combination of `OUT` and `ELPM` instructions.
2. A temporary register is need for `LDI TmpReg, Bank` + `out Rampz, TmpReg`, since `LDI` requires the `TmpReg` to be in range `R16`-`R31`, there are two possible ways
2.1 Direct `LDI TmpReg, Imm` + `Out Rampz, TmpReg` are generated, if a temporary register in range `R16`-`R31` is allocated;
2.2 The TmpReg is used to save/restore R30, and `LDI R30, Imm` + `Out Rampz, R30` are generated, if there is no free temporary register in range `R16`-`R31` can be allocated.
3. `ELPMBRdZPi` and `ELPMWRdZPi` are still left unimplemented as the existing LPMWRdZPi is.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116493/new/
https://reviews.llvm.org/D116493
More information about the llvm-commits
mailing list