aboutsummaryrefslogtreecommitdiff
path: root/x86_64-gen.c
Commit message (Collapse)AuthorAgeFilesLines
...
* x86-64: fix udiv, add cqto instructiongrischka2009-12-191-1/+7
|
* x86-64: Fix stab debug information.Shinichiro Hamaji2009-08-241-1/+2
| | | | | We need 32bit relocations for code and 64bit for debug info. Introduce a new macro R_DATA_PTR to distinguish the two usages.
* cleanup: constify some global datagrischka2009-07-181-3/+3
|
* x86-64: fix load() for const pointers: (void*)-2grischka2009-07-181-21/+22
|
* x86-64: chkstk, allocagrischka2009-07-181-1/+2
|
* pe32+ target: adjust x86_64-gen.cgrischka2009-07-181-25/+115
| | | | | | | | - calling conventions are different: * only 4 registers * stack "scratch area" is always reserved * doubles are mirrored in normal registers - no GOT or PIC there
* Improve the test coverage: !val for float/double/long long f.Shinichiro Hamaji2009-04-181-1/+0
|
* x86-64: Combine buffers of sections before we call tcc_run().Shinichiro Hamaji2009-04-181-1/+1
| | | | | | | - Now we can run tcc -run tcc.c successfully, though there are some bugs. - Remove jmp_table and got_table and use text_section for got and plt entries. - Combine buffers in tcc_relocate(). - Use R_X86_64_64 instead of R_X86_64_32 for R_DATA_32 (now the name R_DATA_32 is inappropriate...).
* Generate PIC code so that we can create shared objects properly.Shinichiro Hamaji2009-04-181-29/+97
| | | | | | - Add got_table in TCCState. This approach is naive and the distance between executable code and GOT can be longer than 32bit. - Handle R_X86_64_GOTPCREL properly. We use got_table for TCC_OUTPUT_MEMORY case for now. - Fix load() and store() so that they access global variables via GOT.
* x86-64: Save RDX and RCX before we use them as function parameters.Shinichiro Hamaji2009-04-181-2/+2
| | | | When the function call is indirect, these registers may be broken to load a function pointer.
* Generate PIC for addresses of symbols.Shinichiro Hamaji2009-04-181-11/+8
|
* A uint64 bug fix on x86-64Shinichiro Hamaji2009-04-181-1/+1
| | | | | 64bit unsigned literal was handled as 32bit integer. Added a unittest to catch this.
* Add support of x86-64.Shinichiro Hamaji2008-12-021-0/+1355
Most change was done in #ifdef TCC_TARGET_X86_64. So, nothing should be broken by this change. Summary of current status of x86-64 support: - produces x86-64 object files and executables. - the x86-64 code generator is based on x86's. -- for long long integers, we use 64bit registers instead of tcc's generic implementation. -- for float or double, we use SSE. SSE registers are not utilized well (we only use xmm0 and xmm1). -- for long double, we use x87 FPU. - passes make test. - passes ./libtcc_test. - can compile tcc.c. The compiled tcc can compile tcc.c, too. (there should be some bugs since the binary size of tcc2 and tcc3 is differ where tcc tcc.c -o tcc2 and tcc2 tcc.c -o tcc3) - can compile links browser. It seems working. - not tested well. I tested this work only on my linux box with few programs. - calling convention of long-double-integer or struct is not exactly the same as GCC's x86-64 ABI. - implementation of tcc -run is naive (tcc -run tcctest.c works, but tcc -run tcc.c doesn't work). Relocating 64bit addresses seems to be not as simple as 32bit environments. - shared object support isn't unimplemented - no bounds checker support - some builtin functions such as __divdi3 aren't supported