tech-toolchain archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: PCC LP64 compiler_rt ((mode (TI))) woe
Den 2016-04-02 kl. 03:26, skrev Toru Nishimura:
Hi, list,
I found PCC can not compile a piece of code. In specific,
it's GCC attribute ((mode (TI))) large size integer designation.
The offending file is
src/sys/external/bsd/compiler_rt/dist/lib/builtins/int_types.h
#if __LP64__
#define CRT_HAS_128BIT
#endif
#ifdef CRT_HAS_128BIT
typedef int ti_int __attribute__ ((mode (TI)));
typedef unsigned tu_int __attribute__ ((mode (TI)));
PCC has mode (TI) logic which is braced out with #ifdef and
that part is not enabled probably due to the lack of code
generator support.
I took a quick look at the TImode for pcc some time ago, and the
#ifdef TARGET_TIMODE is the result of that. This is a trivial
implementation and therefore very inefficient (and not well tested).
Currently it just allocates space on stack for variables (handling as a
struct)
and calls the TI functions for evaluating expressions. Only tested on x86.
Doing a "correct" implementation would require much more work and since
it is a special non-standard case that is almost never used I have not spent
any time on it.
I just tested and at least it generated some code. It might be a reason to
turn it on just to be able to compile compiler_rt, but it probably would
be good
if someone checked the correctness of the generated code first.
-- Ragge
Home |
Main Index |
Thread Index |
Old Index