llvm-project/llvm/lib/Target/AVR
Dylan McKay b9c26a9cfe [AVR] Rewrite the function calling convention.
Summary:
The previous version relied on the standard calling convention using
std::reverse() to try to force the AVR ABI. But this only works for
simple cases, it fails for example with aggregate types.

This patch rewrites the calling convention with custom C++ code, that
implements the ABI defined in https://gcc.gnu.org/wiki/avr-gcc.

To do that it adds a few 16-bit pseudo registers for unaligned argument
passing, such as R24R23. For example this function:

    define void @fun({ i8, i16 } %a)

will pass %a.0 in R22 and %a.1 in R24R23.

There are no instructions that can use these pseudo registers, so a new
register class, DREGSMOVW, is defined to make them apart.

Also the ArgCC_AVR_BUILTIN_DIV is no longer necessary, as it is
identical to the C++ behavior (actually the clobber list is more strict
for __div* functions, but that is currently unimplemented).

Reviewers: dylanmckay

Subscribers: Gaelan, Sh4rK, indirect, jwagen, efriedma, dsprenkels, hiraditya, Jim, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68524

Patch by Rodrigo Rivas Costa.
2020-06-23 21:36:18 +12:00
..
AsmParser [MCStreamer] De-capitalize EmitValue EmitIntValue{,InHex} 2020-02-14 23:08:40 -08:00
Disassembler [AVR] Disassemble double register instructions 2020-06-23 02:18:04 +02:00
MCTargetDesc [AVR] Disassemble instructions with fixed Z operand 2020-06-23 02:17:53 +02:00
TargetInfo CMake: Make most target symbols hidden by default 2020-01-14 19:46:52 -08:00
AVR.h
AVR.td
AVRAsmPrinter.cpp [AsmPrinter][MCStreamer] De-capitalize EmitInstruction and EmitCFI* 2020-02-13 22:08:55 -08:00
AVRCallingConv.td [AVR] Rewrite the function calling convention. 2020-06-23 21:36:18 +12:00
AVRDevices.td [AVR] Fix I/O instructions on XMEGA 2020-05-17 19:46:09 +12:00
AVRExpandPseudoInsts.cpp [AVR][NFC] Use Register instead of unsigned 2020-03-05 11:38:24 +08:00
AVRFrameLowering.cpp [AVR] Remove faulty stack pushing behavior 2020-06-16 13:53:32 +02:00
AVRFrameLowering.h ArrayRef'ize restoreCalleeSavedRegisters. NFCI. 2020-02-29 09:50:23 +01:00
AVRISelDAGToDAG.cpp [AVR][NFC] Use Register instead of unsigned 2020-03-05 11:38:24 +08:00
AVRISelLowering.cpp [AVR] Rewrite the function calling convention. 2020-06-23 21:36:18 +12:00
AVRISelLowering.h [AVR] Rewrite the function calling convention. 2020-06-23 21:36:18 +12:00
AVRInstrFormats.td [AVR] Disassemble double register instructions 2020-06-23 02:18:04 +02:00
AVRInstrInfo.cpp [AVR] Rewrite the function calling convention. 2020-06-23 21:36:18 +12:00
AVRInstrInfo.h [NFC] unsigned->Register in storeRegTo/loadRegFromStack 2020-02-03 14:22:16 +01:00
AVRInstrInfo.td [AVR] Fix miscompilation of zext + add 2020-06-18 16:51:37 +02:00
AVRMCInstLower.cpp
AVRMCInstLower.h
AVRMachineFunctionInfo.h [AVR] Generalize the previous interrupt bugfix to signal handlers too 2020-03-31 19:33:34 +13:00
AVRRegisterInfo.cpp [AVR] Generalize the previous interrupt bugfix to signal handlers too 2020-03-31 19:33:34 +13:00
AVRRegisterInfo.h [AVR][NFC] Use Register instead of unsigned 2020-03-05 11:38:24 +08:00
AVRRegisterInfo.td [AVR] Rewrite the function calling convention. 2020-06-23 21:36:18 +12:00
AVRRelaxMemOperations.cpp
AVRSelectionDAGInfo.h
AVRSubtarget.cpp [AVR] Fix I/O instructions on XMEGA 2020-05-17 19:46:09 +12:00
AVRSubtarget.h [AVR] Fix I/O instructions on XMEGA 2020-05-17 19:46:09 +12:00
AVRTargetMachine.cpp Fix AVR build after 777180a32b 2020-01-28 19:22:22 -05:00
AVRTargetMachine.h
AVRTargetObjectFile.cpp [AVR] Do not place functions in .progmem.data 2020-04-20 13:56:38 +02:00
AVRTargetObjectFile.h
CMakeLists.txt
LLVMBuild.txt
README.md
TODO.md

README.md

AVR backend

This experimental backend is for the 8-bit Atmel AVR microcontroller.