LLVM backend for 6502
Go to file
Stepan Dyatkovskiy b52ba9f8a8 Issue:
Stack is formed improperly for long structures passed as byval arguments for
EABI mode.

If we took AAPCS reference, we can found the next statements:

A: "If the argument requires double-word alignment (8-byte), the NCRN (Next
Core Register Number) is rounded up to the next even register number." (5.5
Parameter Passing, Stage C, C.3).

B: "The alignment of an aggregate shall be the alignment of its most-aligned
component." (4.3 Composite Types, 4.3.1 Aggregates).

So if we have structure with doubles (9 double fields) and 3 Core unused
registers (r1, r2, r3): caller should use r2 and r3 registers only.
Currently r1,r2,r3 set is used, but it is invalid.

Callee VA routine should also use r2 and r3 regs only. All is ok here. This
behaviour is guessed by rounding up SP address with ADD+BFC operations.

Fix:
Main fix is in ARMTargetLowering::HandleByVal. If we detected AAPCS mode and
8 byte alignment, we waste odd registers then.

P.S.:
I also improved LDRB_POST_IMM regression test. Since ldrb instruction will
not generated by current regression test after this patch. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166018 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16 07:16:47 +00:00
autoconf Re-enable support for --program-prefix. 2012-10-01 18:40:32 +00:00
bindings Fix the ocaml binding breakage from TargetData -> DataLayout changes. 2012-10-08 17:06:25 +00:00
cmake [CMake] add_lit_testsuite: EXCLUDE_FROM_ALL excludes the test ${target} out of check-all. 2012-10-10 13:32:55 +00:00
docs Fix a typo in bitcode docs, from 165814. 2012-10-15 16:47:58 +00:00
examples ExceptionDemo.cpp: Use Function::setDoesNotReturn(). Attributes stuff was updated. 2012-10-12 14:11:48 +00:00
include Issue: 2012-10-16 07:16:47 +00:00
lib Issue: 2012-10-16 07:16:47 +00:00
projects Re-enable support for --program-prefix. 2012-10-01 18:40:32 +00:00
runtime Place temporary LTO files into their own subdirectory. 2012-10-10 05:29:15 +00:00
test Issue: 2012-10-16 07:16:47 +00:00
tools LTO also needs to initialize the TargetTransform infrastructure. 2012-10-15 22:50:02 +00:00
unittests Fix a bug in the set(I,E)/reset(I,E) methods that I recently added. The boundary condition for checking if I and E were in the same word were incorrect, and, beyond that, the mask computation was not using a wide enough constant. 2012-10-16 06:04:27 +00:00
utils Add an enum for the return and function indexes into the AttrListPtr object. This gets rid of some magic numbers. 2012-10-15 07:29:08 +00:00
.gitignore Add extra vim swap file pattern 2012-10-09 23:48:34 +00:00
CMakeLists.txt Removing dependency on third party library for Intel JIT event support. 2012-09-28 17:35:20 +00:00
CODE_OWNERS.TXT Add the list of code owners to the top level of the LLVM source tree to 2012-07-26 08:04:09 +00:00
configure Re-enable support for --program-prefix. 2012-10-01 18:40:32 +00:00
CREDITS.TXT Move TargetData to DataLayout. 2012-10-08 16:40:38 +00:00
LICENSE.TXT Add YAML parser to Support. 2012-04-03 23:09:22 +00:00
llvm.spec.in
LLVMBuild.txt
Makefile Remove dead variable. 2012-10-10 18:20:49 +00:00
Makefile.common [docs] Remove unsupported references to ExtraSource variable. 2012-05-15 21:32:27 +00:00
Makefile.config.in Re-enable support for --program-prefix. 2012-10-01 18:40:32 +00:00
Makefile.rules Use MACOSX_DEPLOYMENT_TARGET when it is set. <rdar://problem/12433905> 2012-10-12 21:48:14 +00:00
README.txt test commit 2012-07-11 17:34:12 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.

If you're writing a package for LLVM, see docs/Packaging.html for our
suggestions.