forked from OSchip/llvm-project
b9c26a9cfe
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. |
||
---|---|---|
.. | ||
atomics | ||
calling-conv/c | ||
features | ||
inline-asm | ||
integration | ||
intrinsics | ||
pseudo | ||
relax-mem | ||
PR31344.ll | ||
PR31345.ll | ||
PR37143.ll | ||
add.ll | ||
alloca.ll | ||
and.ll | ||
avr-rust-issue-123.ll | ||
branch-relaxation-long.ll | ||
branch-relaxation.ll | ||
brind.ll | ||
call.ll | ||
clear-bss.ll | ||
cmp.ll | ||
com.ll | ||
copy-data-to-ram.ll | ||
ctlz.ll | ||
ctpop.ll | ||
cttz.ll | ||
directmem.ll | ||
div.ll | ||
dynalloca.ll | ||
eor.ll | ||
expand-integer-failure.ll | ||
frame.ll | ||
frmidx-iterator-bug.ll | ||
hardware-mul.ll | ||
high-pressure-on-ptrregs.ll | ||
icall-func-pointer-correct-addr-space.ll | ||
impossible-reg-to-reg-copy.ll | ||
interrupts.ll | ||
io.ll | ||
issue-cannot-select-bswap.ll | ||
issue-regalloc-stackframe-folding-earlyclobber.ll | ||
jmp-long.ll | ||
large-return-size.ll | ||
lit.local.cfg | ||
load.ll | ||
lower-formal-args-struct-return.ll | ||
lower-formal-arguments-assertion.ll | ||
neg.ll | ||
no-print-operand-twice.ll | ||
or.ll | ||
pre-schedule.ll | ||
progmem-extended.ll | ||
progmem.ll | ||
rem.ll | ||
return.ll | ||
rot.ll | ||
runtime-trig.ll | ||
rust-avr-bug-37.ll | ||
rust-avr-bug-95.ll | ||
rust-avr-bug-99.ll | ||
rust-avr-bug-112.ll | ||
sections.ll | ||
select-must-add-unconditional-jump.ll | ||
sext.ll | ||
shift.ll | ||
sign-extension.ll | ||
smul-with-overflow.ll | ||
software-mul.ll | ||
std-ldd-immediate-overflow.ll | ||
store-undef.ll | ||
store.ll | ||
sub.ll | ||
trunc.ll | ||
umul-with-overflow.ll | ||
umul.with.overflow.i16-bug.ll | ||
unaligned-atomic-loads.ll | ||
varargs.ll | ||
xor.ll | ||
zext.ll |