[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] Generic integer value test
From: |
Thomas Preud'homme |
Subject: |
[Tinycc-devel] Generic integer value test |
Date: |
Fri, 03 Jan 2014 11:12:40 +0800 |
User-agent: |
KMail/4.11.3 (Linux/2.6.38-ac2-ac100; KDE/4.11.3; armv7l; ; ) |
Hi there,
while trying to fix the test of long long value on 32 bits architectures, I was
wondering whether this code should be done in tccgen.c instead of in each
architecture. There is already the comparison logic required to test if a
value is different than 0 in each architecture. Why not detect when an integer
is tested and convert to a comparison? So I did just this and the git stat is:
arm-gen.c | 25 +------------------------
c67-gen.c | 33 +--------------------------------
i386-gen.c | 19 +------------------
il-gen.c | 15 +--------------
tccgen.c | 44 ++++++++++++++++++++++++++++++++------------
x86_64-gen.c | 19 +------------------
6 files changed, 37 insertions(+), 118 deletions(-)
I tried the patch with make test and it seems to work. is there a fundamental
problem with this approache or a bug in the current patch? For those reading
the patch, basically the test is made in a new function gvtst (gen value test)
and tccgen.c is updated to use this function in place of gtst for all tests
that works on value (?: not being the case with gnu extension for instance)
and removing all the corresponding code in each architecture.
Best regards,
Thomas
generic_int_value_test.diff
Description: Text Data
- [Tinycc-devel] Generic integer value test,
Thomas Preud'homme <=