[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mes wip-arm state
From: |
Jan Nieuwenhuizen |
Subject: |
Re: mes wip-arm state |
Date: |
Mon, 01 Jun 2020 08:33:30 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Danny Milosavljevic writes:
Hello Danny,
> On Sun, 31 May 2020 23:08:13 +0200
> Jan Nieuwenhuizen <janneke@gnu.org> wrote:
>
>> > FAIL: lib/tests/scaffold/7l-struct-any-size-array-simple.c
>> > FAIL: lib/tests/scaffold/7r-sign-extend.c
>>
>> So this is a test-suite bug, right? Are the tests broken or should they
>> be marked XFAIL (for ARM?)
>
> I think that these tests are broken--or at least not applicable on ARM.
>
> Both tests basically do
>
> {
> char c = -1;
> int i = c;
> }
>
> and char is unsigned on ARM, so i will NEVER contain a negative value (reason:
> because of C integer promotion rules).
Ouch, yes I see.
> If those are from tcc, let's check whether they force signed char by compiler
> option.
I checked and I don't believe they do. tcc does have the -fsigned-char,
-funsigned-char options though. So, some client code (in the Guix
bootstrap) just might use that. Unlikely, right? We'll see.
In arm-gen.c I found
#define CHAR_IS_UNSIGNED
but they also use
typedef signed char int8_t;
...
int8_t reg; /* register, -1 if none */
...
signed char avail[3]; /* 3 holes max with only float and double alignments
*/
so signed chars should work. How about just adding 'signed' to those
tests above? We're really testing if sign extension works -- testing
for signdness of char could/should be another test. WDYT?
>> > # FAIL: 0
>>
>> Congratulations, that's just terriffic \o/
>
> Yeah. I like it!
>
> What's the next step? Should we merge this part to master?
>
> After that, make tcc work?
Yes. And then: the Reduced binary bootstrap for Guix!
As we cannot rewrite master, I'd like to check if we didn't break
anything for mes-x86 :-)
We can also make tcc work before merging, but we could also start a new
wip-tcc / wip-arm-tcc later if the need arises. Whatever works for you!
As you propbably have seen, in the bootstrap we use a forked tcc:
somewhat older (0.9.27), patched.
https://gitlab.com/janneke/tinycc/-/tree/mes-0.21
I'm hoping to get rid of that fork, some time. That needs work...
Functionality-wise, the fork supports a gradual introduction of
bitfield, float/double and long long, by using #define switches.
It also has this
--8<---------------cut here---------------start------------->8---
17df781 * Revert "lotsa debug printing."
ba1c47d * lotsa debug printing.
--8<---------------cut here---------------end--------------->8---
debugging aid, which was created ad-hoc but is a pretty good start to
help bisecting a piece of wrongly compiled code; by ascii-diffing
gcc-compiled and mescc-compiled runs of tcc.
Greetings,
Janneke
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com
- Re: mes wip-arm state,
Jan Nieuwenhuizen <=