aboutsummaryrefslogtreecommitdiff
path: root/lib/libtcc1.c
Commit message (Collapse)AuthorAgeFilesLines
* Trim trailing spaces everywhere.gus knight2015-07-271-13/+13
|
* x86-64: Fix stdarg for large non-float structsMichael Matz2015-03-091-4/+3
| | | | | | | | | | Some structs are passed in registers. When they need more than one the implementation of __va_arg on x86-64 didn't correctly account for this. This fixes only the cases where the structs consist of integer types, as there the register save area is consecutive. Fixes some tests from 73_arm64.c, but still leaves those failing that use floating point in the large-but-regpassed structs.
* partial revert of the commit 4ad186c5ef61seyko2015-03-041-0/+14
| | | | | | | | | | | | | | | A test program: /* result of the new version inroduced in 4ad186c5ef61: t2a = 44100312 */ #include<stdio.h> int main() { int t1 = 176401255; float f = 0.25f; int t2a = (int)(t1 * f); // must be 44100313 int t2b = (int)(t1 * (float)0.25f); printf("t2a=%d t2b=%d \n",t2a,t2b); return 0; }
* x86_64-tcc and libtcc1.c: size_t definition is needed for a x86_64-tcc to ↵seyko2015-03-031-1/+2
| | | | parse memset()
* New implementation of va_list/va_start/var_copy that do not use dynamic ↵mingodad2014-03-281-21/+9
| | | | memory, with this when compiling fossil-scm with tcc on linux X86_64 it works fine.
* Fix __clear_cache implementationThomas Preud'homme2014-03-111-1/+2
| | | | Forgot to give the parameters to syscall function, doh!
* Use intptr_t to cast pointerThomas Preud'homme2014-03-091-1/+3
|
* Undefine __va* in libtcc1 to avoid errors w/ clangThomas Preud'homme2014-03-091-0/+5
|
* Make condition in libtcc1 based on targetThomas Preud'homme2014-03-091-5/+5
| | | | | | Prior to this commit runtime library was compiled according to the host because of the macro used to detec what architecture to choose. This commit fixes this by using the TARGET_* macro instead.
* i386: use __fixdfdi instead of __tcc_cvt_ftolgrischka2014-01-061-18/+21
| | | | | | | | | | | | Variants __fixsfdi/__fixxfdi are not needed for now because the value is converted to double always. Also: - remove __tcc_fpinit for unix as it seems redundant by the __setfpucw call in the startup code - avoid reference to s->runtime_main in cross compilers - configure: fix --with-libgcc help - tcctok.h: cleanup
* Add __clear_cache implementation in libtcc1Thomas Preud'homme2013-11-051-1/+23
| | | | Add __clear_cache function for flushing caches to libtcc1.
* libtcc1.c: Fix __asm__() in __tcc_fpinit and __tcc_cvt_ftolRamsay Jones2013-09-091-3/+3
| | | | Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
* i386-gen: preserve fp control word in gen_cvt_ftoigrischka2013-08-281-6/+17
| | | | | | | | | | | | | | | | | | | | | | | - Use runtime function for conversion - Also initialize fp with tcc -run on windows This fixes a bug where double x = 1.0; double y = 1.0000000000000001; double z = x < y ? 0 : sqrt (x*x - y*y); caused a bad sqrt because rounding precision for the x < y comparison was different to the one used within the sqrt function. This also fixes a bug where printf("%d, %d", (int)pow(10, 2), (int)pow(10, 2)); would print 100, 99 Unrelated: win32: document relative include & lib lookup win32: normalize_slashes: do not mirror silly gcc behavior This reverts part of commit 8a81f9e1036637e21a47e14fb56bf64133546890 winapi: add missing WINAPI decl. for some functions
* Fixed x86-64 long double passing.James Lyon2013-04-261-1/+3
| | | | | | long double arguments require 16-byte alignment on the stack, which requires adjustment when the the stack offset is not an evven number of 8-byte words.
* Sorted out CMake on x86-64 and fixed silly XMM# bug introduced when working ↵James Lyon2013-04-251-0/+7
| | | | | | | | | on Win64 stdargs. I removed the XMM6/7 registers from the register list because they are not used on Win64 however they are necessary for parameter passing on x86-64. I have now restored them but not marked them with RC_FLOAT so they will not be used except for parameter passing.
* Added cross compilation to CMake build system.James Lyon2013-04-251-7/+3
| | | | | Brings it more into line with make based system. I've tested on 32- and 64-bit Windows, but not yet Linux.
* Flush caches before -running programThomas Preud'homme2013-03-181-0/+11
| | | | | | | | | | | | On some architectures, ARM for instance, the data and instruction caches are not coherent with each other. This is a problem for the -run feature since instructions are written in memory, and are thus written in the data cache first and then later flushed to the main memory. If the instructions are executed before they are pushed out of the cache, then the processor will fetch the old content from the memory and not the newly generated code. The solution is to flush from the data cache all the data in the memory region containing the instructions and to invalidate the same region in the instruction cache.
* - document -dumpversionUrs Janssen2013-02-151-1/+1
| | | | - fixed a broken prototype
* configure: pass CONFIG_xxxDIR/PATH options via commandlinegrischka2013-02-141-1/+6
| | | | | | | | | | | | | | | - except for CONFIG_SYSROOT and CONFIG_TCCDIR Strictly neccessary it is only for CONFIG_MULTIARCHDIR because otherwise if it's in config.h it is impossible to leave it undefined. But it is also nicer not to use these definitions for cross-compilers. - Also: lib/Makefile : include ../Makefile for CFLAGS lib/libtcc1.c : fix an issue compiling tcc with tcc on x64
* Support struct arguments with stdarg.hShinichiro Hamaji2010-12-281-0/+79
| | | | | | | | - add __builtin_va_arg_types to check how arguments were passed - move most code of stdarg into libtcc1.c - remove __builtin_malloc and __builtin_free - add a test case based on the bug report (http://www.mail-archive.com/tinycc-devel@nongnu.org/msg03036.html)
* new subdirs: include, lib, testsgrischka2009-04-181-0/+607