aboutsummaryrefslogtreecommitdiff
path: root/arm64-gen.c
Commit message (Collapse)AuthorAgeFilesLines
* configure: --config-musl/-uClibc switch & misc cleanupsgrischka2017-05-131-1/+1
| | | | | | | | | | | | | | | - configure: - add --config-uClibc,-musl switch and suggest to use it if uClibc/musl is detected - make warning options magic clang compatible - simplify (use $confvars instead of individual options) - Revert "Remove some unused-parameter lint" 7443db0d5f841b81a55e918bf8c228dd20f9ddb2 rather use -Wno-unused-parameter (or just not -Wextra) - #ifdef functions that are unused on some targets - tccgen.c: use PTR_SIZE==8 instead of (X86_64 || ARM64) - tccpe.c: fix some warnings - integrate dummy arm-asm better
* tccgen: factor out gfunc_returngrischka2017-02-081-6/+7
| | | | | | | Also: - on windows i386 and x86-64, structures of size <= 8 are NOT returned in registers if size is not one of 1,2,4,8. - cleanup: put all tv-push/pop/swap/rot into one place
* tccgen: nocode_wanted alternativelygrischka2016-12-181-0/+4
| | | | | | | | | | | | | | | tccgen.c: remove any 'nocode_wanted' checks, except in - greloca(), disables output elf symbols and relocs - get_reg(), will return just the first suitable reg) - save_regs(), will do nothing Some minor adjustments were made where nocode_wanted is set. xxx-gen.c: disable code output directly where it happens in functions: - g(), output disabled - gjmp(), will do nothing - gtst(), dto.
* arm64: Fix largeptr testMichael Matz2016-12-151-1/+2
| | | | VT_PTR needs to be handled like VT_LLONG.
* Fix relocs_info declaration in tcc.hThomas Preud'homme2016-12-051-14/+0
| | | | | | | | | C standard specifies that array should be declared with a non null size or with * for standard array. Declaration of relocs_info in tcc.h was not respecting this rule. This commit add a R_NUM macro that maps to the R_<ARCH>_NUM macros and declare relocs_info using it. This commit also moves all linker-related macros from <arch>-gen.c files to <arch>-link.c ones.
* Make build_got_entries more target independentThomas Preud'homme2016-12-031-0/+1
| | | | | Factor most of common logic between targets in build_got_entries by defining target specific info into structures in the backends.
* arm64: Fix -runMichael Matz2016-10-141-14/+2
| | | | | | | With -run the call instruction and a defined function can be far away, if the function is defined in the executable itself, not in the to be compiled code. So we always need PLT slots for -run, not just for undefined symbols.
* Use R_AARCH64_MOVW_UABS_G* instead of R_AARCH64_CALL26.Edmund Grimley Evans2016-10-111-5/+14
| | | | | | This is a work-around for TCC's linker, on AArch64, not building a PLT when TCC is invoked with "-run". Fixing the linker should be possible: it works on arm and x86_64, apparently.
* In gen_vla_sp_restore, use X30 rather than get_reg.Edmund Grimley Evans2016-10-101-1/+4
|
* Replace pointer casts with calls to (read|write)(16|32|64)le.Edmund Grimley Evans2015-11-191-19/+14
| | | | | This stops UBSan from giving runtime misaligned address errors and might eventually allow building on a non-little-endian host.
* Merge the integer members of union CValue into "uint64_t i".Edmund Grimley Evans2015-11-171-13/+7
|
* arm64-gen.c: Avoid some cases of undefined behaviour.Edmund Grimley Evans2015-11-091-44/+55
| | | | Also make some functions more portable.
* Enable variable-length arrays on arm64.Edmund Grimley Evans2015-10-311-3/+11
| | | | | arm64-gen.c: Implement gen_vla_sp_save, gen_vla_sp_restore, gen_vla_alloc. tests/Makefile: Run vla_test on arm64.
* Revert "fix-mixed-struct (patch by Pip Cet)"gus knight2015-07-291-10/+1
| | | | This reverts commit 4e04f67c94c97b4f28a4d73759a0ad38fb3a10f7. Requested by grischka.
* Revert all of my changes to directories & codingstyle.gus knight2015-07-291-0/+1846
|
* Reorganize the source tree.gus knight2015-07-271-1846/+0
| | | | | | | | | | * Documentation is now in "docs". * Source code is now in "src". * Misc. fixes here and there so that everything still works. I think I got everything in this commit, but I only tested this on Linux (Make) and Windows (CMake), so I might've messed something up on other platforms...
* fix-mixed-struct (patch by Pip Cet)seyko2015-05-141-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jsut for testing. It works for me (don't break anything) Small fixes for x86_64-gen.c in "tccpp: fix issues, add tests" are dropped in flavor of this patch. Pip Cet: Okay, here's a first patch that fixes the problem (but I've found another bug, yet unfixed, in the process), though it's not particularly pretty code (I tried hard to keep the changes to the minimum necessary). If we decide to actually get rid of VT_QLONG and VT_QFLOAT (please, can we?), there are some further simplifications in tccgen.c that might offset some of the cost of this patch. The idea is that an integer is no longer enough to describe how an argument is stored in registers. There are a number of possibilities (none, integer register, two integer registers, float register, two float registers, integer register plus float register, float register plus integer register), and instead of enumerating them I've introduced a RegArgs type that stores the offsets for each of our registers (for the other architectures, it's simply an int specifying the number of registers). If someone strongly prefers an enum, we could do that instead, but I believe this is a place where keeping things general is worth it, because this way it should be doable to add SSE or AVX support. There is one line in the patch that looks suspicious: } else { addr = (addr + align - 1) & -align; param_addr = addr; addr += size; - sse_param_index += reg_count; } break; However, this actually fixes one half of a bug we have when calling a function with eight double arguments "interrupted" by a two-double structure after the seventh double argument: f(double,double,double,double,double,double,double,struct { double x,y; },double); In this case, the last argument should be passed in %xmm7. This patch fixes the problem in gfunc_prolog, but not the corresponding problem in gfunc_call, which I'll try tackling next.
* Fix stack overwrite on structure returnMichael Matz2015-03-091-1/+1
| | | | | | | | | The common code to move a returned structure packed into registers into memory on the caller side didn't take the register size into account when allocating local storage, so sometimes that lead to stack overwrites (e.g. in 73_arm64.c), on x86_64. This fixes it by generally making gfunc_sret also return the register size.
* arm64: Implement __clear_cache.Edmund Grimley Evans2015-03-081-0/+48
| | | | | | __clear_cache is defined in lib-arm64.c with a single call to __arm64_clear_cache, which is the real built-in function and is turned into inline assembler by gen_clear_cache in arm64-gen.c
* arm64: Optimise some integer operations with a constant operand.Edmund Grimley Evans2015-03-071-2/+124
|
* arm64-gen.c: In load(), do not sign-extend 32-bit VT_CONST.Edmund Grimley Evans2015-03-071-2/+2
|
* arm64-gen.c: Improve generation of stack offsets.Edmund Grimley Evans2015-03-021-2/+10
|
* arm64-gen.c: Rename some functions and add comments.Edmund Grimley Evans2015-03-021-76/+79
|
* arm64: Improve constant generation, with tests.Edmund Grimley Evans2015-03-021-8/+22
|
* arm64-gen.c: Better explanation of relocation choice.Edmund Grimley Evans2015-03-011-21/+24
|
* arm64-gen.c: In gen_va_arg, handle the remaining HFA cases.Edmund Grimley Evans2015-02-251-9/+27
|
* Add arm64 (AArch64) as a target architecture.Edmund Grimley Evans2015-02-231-0/+1621