History log of /tinycc/arm-gen.c (Results 1 - 25 of 105)
Revision Date Author Comments
# 9c283497 05-May-2020 grischka <grischka>

tccgen.c: cleanup debug support

from 3e731e3a78c0b1f9a299afee2665b11d3c4c25fe

tccgen.c:
- make 'struct default_debug' const
- pass TCCState* as parameter to tcc_debug_xxx fu

tccgen.c: cleanup debug support

from 3e731e3a78c0b1f9a299afee2665b11d3c4c25fe

tccgen.c:
- make 'struct default_debug' const
- pass TCCState* as parameter to tcc_debug_xxx functions
- always check tcc_state->do_debug before calling functions
- factor out tcc_debug_extern_sym()
- remove formats "%lld"/"%llu" (not reliable on windows)

xxx-gen files:
- set func_vt/var from caller

show more ...


# ef42295f 17-Jan-2020 gr <gr@gr-laptop.(none)>

tccrun.c: standalone backtraces with -bt[N] or -b

This makes it possible to get backtraces with executables
(including DLLs/SOs) like we had it already with -g -run.

Option -b i

tccrun.c: standalone backtraces with -bt[N] or -b

This makes it possible to get backtraces with executables
(including DLLs/SOs) like we had it already with -g -run.

Option -b includes -bt, and -bt includes -g.

- new file lib/bt-exe.c: used to link rt_printline and the
exception handler from tccrun.c into executables/DLLs.

- new file lib/bt-log.c: provides a function that may be
called from user code to print out a backtrace with a
message (currently for i386/x86_64 only):

int (*tcc_backtrace)(const char *fmt, ...);

As an extra hack, if 'fmt' is prefixed like "^file.c^..."
then the backtrace will skip calls from within 'file.c'.

- new file lib/bt-dll.c: used on win32 to link the backtrace
and bcheck functions with the main module at runtime

- bcheck.c: now uses the tcc_backtrace function from above

- tccgen.c: minor cleanups

- tccelf.c: stab sections get SHF_ALLOC for easy access.
Also in relocate_section(): 64bit relocations for stabs
in DLLs cannot work. To find DLL addresses, the DLL base
is added manually in tccrun.c via rc.prog_base instead.

- tccpe.c: there are some changes to allow merging sections,
used to merge .finit_array into .data in the first place.

- tccpp.c: tcc -run now #defines __TCC_RUN__
also: refactor a line in tal_realloc that was incompatible
with bcheck

- tcctest.c: fixed a problem with r12 which tcc cannot preserve
as well as gcc does.

- tests2/112_backtrace.c: test the feature and the bcheck test18
that previously was in boundtest.c

show more ...


# 35475b54 16-Dec-2019 grischka <grischka>

remove VT_LVAL_BYTE etc.

For some reason there was no point for that anymore.


# 5914f4d5 16-Dec-2019 grischka <grischka>

tccgen.c: cleanup reg classes

wrap some copy&paste code into functions


# 72729d8e 10-Dec-2019 grischka <grischka>

allow libtcc states to be used concurrently

This allows creation of TCCStates and operation with API
calls independently from each other, even from threads.

Frontend (option par

allow libtcc states to be used concurrently

This allows creation of TCCStates and operation with API
calls independently from each other, even from threads.

Frontend (option parsing/libtcc.c) and backend (linker/tccelf.c)
now depend only on the TCCState (s1) argument.

Compilation per se (tccpp.c, tccgen.c) is still using
globals for convenience. There is only one entry point
to this section which is tcc_compile() which is protected
by a semaphore.

There are some hacks involved to avoid too many changes,
as well as some changes in order to avoid too many hacks ;)

The test libtcc_test_mt.c shows the feature. Except this
new file the patch adds 87 lines overall.

show more ...


# 4461f38a 10-Dec-2019 herman ten brugge <hermantenbrugge@home.nl>

Fix bounds checking for linux/windows


# a4997bf3 25-Jun-2019 Christian Jullien <jullien@eligis.com>

Inverse last intr test so that function always returns. This prevents warning as found with gcc 8.3 and it matches other function styles doing the same in ARM generator.


# 8227db3a 22-Jun-2019 grischka <grischka>

jump optimizations

This unifies VT_CMP with VT_JMP(i) by using mostly VT_CMP
with both a positive and a negative jump target list.

Such we can delay putting the non-inverted or

jump optimizations

This unifies VT_CMP with VT_JMP(i) by using mostly VT_CMP
with both a positive and a negative jump target list.

Such we can delay putting the non-inverted or inverted jump
until we can see which one is nore suitable (in most cases).

example:
if (a && b || c && d)
e = 0;

before this patch:
a: 8b 45 fc mov 0xfffffffc(%ebp),%eax
d: 83 f8 00 cmp $0x0,%eax
10: 0f 84 11 00 00 00 je 27 <main+0x27>
16: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
19: 83 f8 00 cmp $0x0,%eax
1c: 0f 84 05 00 00 00 je 27 <main+0x27>
22: e9 22 00 00 00 jmp 49 <main+0x49>
27: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
2a: 83 f8 00 cmp $0x0,%eax
2d: 0f 84 11 00 00 00 je 44 <main+0x44>
33: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
36: 83 f8 00 cmp $0x0,%eax
39: 0f 84 05 00 00 00 je 44 <main+0x44>
3f: e9 05 00 00 00 jmp 49 <main+0x49>
44: e9 08 00 00 00 jmp 51 <main+0x51>
49: b8 00 00 00 00 mov $0x0,%eax
4e: 89 45 ec mov %eax,0xffffffec(%ebp)
51: ...

with this patch:
a: 8b 45 fc mov 0xfffffffc(%ebp),%eax
d: 83 f8 00 cmp $0x0,%eax
10: 0f 84 0c 00 00 00 je 22 <main+0x22>
16: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
19: 83 f8 00 cmp $0x0,%eax
1c: 0f 85 18 00 00 00 jne 3a <main+0x3a>
22: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
25: 83 f8 00 cmp $0x0,%eax
28: 0f 84 14 00 00 00 je 42 <main+0x42>
2e: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
31: 83 f8 00 cmp $0x0,%eax
34: 0f 84 08 00 00 00 je 42 <main+0x42>
3a: b8 00 00 00 00 mov $0x0,%eax
3f: 89 45 ec mov %eax,0xffffffec(%ebp)
42: ...

show more ...


# 1b575605 29-Apr-2019 grischka <grischka>

nocode, noreturn

A more automatic approach to code suppression (aka. nocode_wanted)

The simple rules are:
- Clear 'nocode_wanted' at (im/explicit) label IF it was used
- Set

nocode, noreturn

A more automatic approach to code suppression (aka. nocode_wanted)

The simple rules are:
- Clear 'nocode_wanted' at (im/explicit) label IF it was used
- Set 'nocode_wanted' after unconditional jumps

Also in order to test this then I did add the "function might
return no value" warning, and then to make that work again I
did add the __attribute__((noreturn)).

Also moved the look ahead label check into the type parser
to gain a little speed.

show more ...


# ecb90de4 11-Jan-2019 Pursuer <1596067968@qq.com>

FIX:Revert commit 3f05d88d5bda06b40280710089bd3ede3a8fdaa0

The function should to be saved to stack in some cases (fastcall on i386, struct argument on arm etc.). But I neglected. So I rever

FIX:Revert commit 3f05d88d5bda06b40280710089bd3ede3a8fdaa0

The function should to be saved to stack in some cases (fastcall on i386, struct argument on arm etc.). But I neglected. So I revert this commit.

show more ...


# 3f05d88d 10-Jan-2019 Pursuer <1596067968@qq.com>

optimize the generated code when save_reg is required (2)

In gfunc_call, regisger will be saved before gcall_or_jmp. The register
stored the function will be saved too, though in some ge

optimize the generated code when save_reg is required (2)

In gfunc_call, regisger will be saved before gcall_or_jmp. The register
stored the function will be saved too, though in some generator the SValue
of this function will be immediately poped after gcall_or_jmp, and no need to be saved. So I modify some generator to avoid save redundant SValue before gcall_or_jmp.

show more ...


# 0c313f49 08-Jan-2019 Pursuer <1596067968@qq.com>

Insert arm-xxx_FILES into Makefile to suport CROSS_TARGET and Remove duplicate function lexpand_nr


# bf09349f 22-Dec-2018 general <general>

fix arm-gen.c -> gcall_or_jmp to VT_CONST


# 671dcace 06-Apr-2018 Michael Matz <matz@suse.de>

Implement function alignment via attributes

which requires being able to emit an arbitrary number of NOP
instructions, which is also implemented here. For x86 we
could emit other se

Implement function alignment via attributes

which requires being able to emit an arbitrary number of NOP
instructions, which is also implemented here. For x86 we
could emit other sequences but these are the easiest.

show more ...


# 1b6806e5 24-Sep-2017 Larry Doolittle <ldoolitt@recycle.lbl.gov>

Spelling fixes

Comments only, no change to functionality


# 9ba76ac8 09-Jul-2017 grischka <grischka>

refactor sym & attributes

tcc.h:
* cleanup struct 'Sym'
* include some 'Attributes' into 'Sym'
* in turn get rid of VT_IM/EXPORT, VT_WEAK
* re-number VT_XXX flags
* repla

refactor sym & attributes

tcc.h:
* cleanup struct 'Sym'
* include some 'Attributes' into 'Sym'
* in turn get rid of VT_IM/EXPORT, VT_WEAK
* re-number VT_XXX flags
* replace some 'long' function args by 'int'

tccgen.c:
* refactor parse_btype()

show more ...


# 28435ec5 13-May-2017 grischka <grischka>

configure: --config-musl/-uClibc switch & misc cleanups

- configure:
- add --config-uClibc,-musl switch and suggest to use
it if uClibc/musl is detected
- make warning op

configure: --config-musl/-uClibc switch & misc cleanups

- 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

show more ...


# 56df2750 08-May-2017 Christian Jullien <Christian Jullien>

C string litteral is const, fix return type of default_elfinterp. Remove #ifndef TCC_IS_NATIVE in arm-gen.c as suggested by grischka.


# 19d8b8a1 07-May-2017 Larry Doolittle <ldoolitt@recycle.lbl.gov>

Spelling fixes in C comments only


# 44abffe3 07-May-2017 grischka <grischka>

more minor fixes

* tccgen: re-allow long double constants for x87 cross
sizeof (long double) may be 12 or 16 depending on host platform
(i386/x86_64 on unix/windows).
Excep

more minor fixes

* tccgen: re-allow long double constants for x87 cross
sizeof (long double) may be 12 or 16 depending on host platform
(i386/x86_64 on unix/windows).
Except that it's 8 if the host is on windows and not gcc
was used to compile tcc.

* win64: fix builtin_va_start after VT_REF removal
See also a8b83ce43a95fa519dacfe7690a3a0098af7909c

* tcctest.c: remove outdated limitation for ll-bitfield test
It always worked, there is no reason why it should not work
in future.

* libtcc1.c: exclude long double conversion on ARM

* Makefile: remove CFLAGS from link recipes

* lib/Makefile: use target DEFINES as passed from main Makefile

* lib/armflush.c lib/va_list.c: factor out from libtcc1.c

* arm-gen.c: disable "depreciated" warnings for now

show more ...


# 569255e6 23-Feb-2017 grischka <grischka>

cross-compilers: allow individual configuration

since configure supports only native configuration
a file 'cross-tcc.mak' needs to be created manually.
It is included in the Makefile

cross-compilers: allow individual configuration

since configure supports only native configuration
a file 'cross-tcc.mak' needs to be created manually.
It is included in the Makefile if present.

# ----------------------------------------------------
# Example config-cross.mak:
#
# windows -> i386-linux cross-compiler
# (it expects the linux files in <prefix>/i386-linux)

ROOT-i386 = {B}/i386-linux
CRT-i386 = $(ROOT-i386)/usr/lib
LIB-i386 = $(ROOT-i386)/lib:$(ROOT-i386)/usr/lib
INC-i386 = {B}/lib/include:$(ROOT-i386)/usr/include
DEF-i386 += -D__linux__

# ----------------------------------------------------

Also:
- use libtcc1-<target>.a instead of directories
- add dummy arm assembler
- remove include dependencies from armeabi.c/lib-arm64.c
- tccelf/ld_add_file: add SYSROOT (when defined) to absolute
filenames coming from ld-scripts

show more ...


# a4a20360 13-Feb-2017 grischka <grischka>

fixes & cleanups

- tccgen.c/tcc.h: allow function declaration after use:
int f() { return g(); }
int g() { return 1; }
may be a warning but not an error
see a

fixes & cleanups

- tccgen.c/tcc.h: allow function declaration after use:
int f() { return g(); }
int g() { return 1; }
may be a warning but not an error
see also 76cb1144ef91924c53c57ea71e6f67ce73ce1cc6

- tccgen.c: redundant code related to inline functions removed
(functions used anywhere have sym->c set automatically)

- tccgen.c: make 32bit llop non-equal test portable
(probably not on C67)

- dynarray_add: change prototype to possibly avoid aliasing
problems or at least warnings

- lib/alloca*.S: ".section .note.GNU-stack,"",%progbits" removed
(has no effect)

- tccpe: set SizeOfCode field (for correct upx decompression)

- libtcc.c: fixed alternative -run invocation
tcc "-run -lxxx ..." file.c
(meant to load the library after file).
Also supported now:
tcc files ... options ... -run @ arguments ...

show more ...


# f843cadb 18-Dec-2016 grischka <grischka>

tccgen: nocode_wanted alternatively

tccgen.c: remove any 'nocode_wanted' checks, except in
- greloca(), disables output elf symbols and relocs
- get_reg(), will return just the first

tccgen: nocode_wanted alternatively

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.

show more ...


# 59391d55 05-Dec-2016 Thomas Preud'homme <robotux@celest.fr>

Fix relocs_info declaration in tcc.h

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

Fix relocs_info declaration in tcc.h

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.

show more ...


# 1c811a4d 12-Nov-2016 Thomas Preud'homme <robotux@celest.fr>

Make build_got_entries more target independent

Factor most of common logic between targets in build_got_entries by
defining target specific info into structures in the backends.


12345