Re: [Tinycc-devel] x86_64 tcc doesn't set sign bit on NaNs

2021-01-03 Thread arnold
Michael Matz wrote: > Yeah, I think that's merely a typo in Arnolds email. The inconsistency is > there, applying unary '-' to a NaN doesn't change the sign of it in TCC. Yep, that was the issue. Sorry I wasn't clear. > So the current "-0.0-x" expansion of unary '-' needs a change. It turned

Re: [Tinycc-devel] x86_64 tcc doesn't set sign bit on NaNs

2021-01-03 Thread Christian Jullien
Also on OpenBSD x64 with clang 10 ./configure --strip-binaries --with-selinux --cc=clang --prefix=/home/jullien/tinycc/static Binary directory/home/jullien/tinycc/static/bin TinyCC directory/home/jullien/tinycc/static/lib/tcc Library directory /home/jullien/tinycc/static/lib Include dir

Re: [Tinycc-devel] x86_64 tcc doesn't set sign bit on NaNs

2021-01-03 Thread Christian Jullien
Hi Michael, The fix does not make the test suite happy, at least, on Linux Aarch64 when clang is used (gcc and tcc are Ok): ./configure --strip-binaries --with-selinux --cc=clang --prefix=/home/jullien/tinycc/static Binary directory/home/jullien/tinycc/static/bin TinyCC directory/home/ju

Re: [Tinycc-devel] arm-asm: Test script

2021-01-03 Thread Michael Matz
Hello, On Sun, 3 Jan 2021, Danny Milosavljevic wrote: Updated test script for all of this (should I also commit this? Where?): Yeah, put it into tests/ I'd say. The x86 assembler also has a little testfile in there that isn't used by default (as it shows a few differences between GNU as a

Re: [Tinycc-devel] x86_64 tcc doesn't set sign bit on NaNs

2021-01-03 Thread Michael Matz
Hello, On Mon, 4 Jan 2021, Vincent Lefevre wrote: - #include #include #include int main(int argc, char **argv) { double d = strtod("-nan", NULL); d = -d; printf("%g, signbit(d) = %d\n", d, signbit(d)); return 0; } -

Re: [Tinycc-devel] x86_64 tcc doesn't set sign bit on NaNs

2021-01-03 Thread Vincent Lefevre
On 2021-01-03 21:17:03 +0200, Arnold Robbins wrote: > Hi. > > I found this bug in current mob on the current gawk sources. Test case: > > - > #include > #include > #include > > int main(int argc, char **argv) > { > double d = strtod("-nan", NULL); > d =

[Tinycc-devel] x86_64 tcc doesn't set sign bit on NaNs

2021-01-03 Thread Arnold Robbins
Hi. I found this bug in current mob on the current gawk sources. Test case: - #include #include #include int main(int argc, char **argv) { double d = strtod("-nan", NULL); d = -d; printf("%g, signbit(d) = %d\n", d, signbit(d)); retur

Re: [Tinycc-devel] arm-asm breaks aarch64 (as with Fedora 33 on RPi)

2021-01-03 Thread Christian Jullien
Great! I confirm it fixes the arm64 reloc issue. -Original Message- From: Herman ten Brugge [mailto:hermantenbru...@home.nl] Sent: Sunday, January 03, 2021 19:22 To: jull...@eligis.com; tinycc-devel@nongnu.org Subject: Re: [Tinycc-devel] arm-asm breaks aarch64 (as with Fedora 33 on RPi)

Re: [Tinycc-devel] arm-asm breaks aarch64 (as with Fedora 33 on RPi)

2021-01-03 Thread Herman ten Brugge via Tinycc-devel
On 1/3/21 4:10 PM, Danny Milosavljevic wrote: Hi Herman, you committed a patch enabling all ARM 32 bit assembly tokens on aarch64. Just a heads-up that you have to mode switch the CPU in order to be able to execute ARM 32 bit machine code on aarch64. I mean the tokens alone are not that bad (t

Re: [Tinycc-devel] arm-asm breaks aarch64 (as with Fedora 33 on RPi)

2021-01-03 Thread Herman ten Brugge via Tinycc-devel
On 1/3/21 4:07 PM, Christian Jullien wrote: Hello, I confirm it is fixed except, probably not related to you commits, on Aarch64 Linux using clang, I get: ./configure --strip-binaries --with-selinux --cc=clang --prefix=/home/jullien/tinycc/static dlltest with PIC tcc:

[Tinycc-devel] arm-asm: Test script

2021-01-03 Thread Danny Milosavljevic
Updated test script for all of this (should I also commit this? Where?): #!/bin/sh set -e cd ~/src/tinycc-upstream/tinycc cat arm-tok.h |grep DEF_ASM_CONDED |grep -v '#define' |grep -v '/[*]' |sed -e 's;DEF_ASM_CONDED.\(.*\).$;\1;'| grep -v 'not useful' >L total_count=0 # Note: "{r3}" is defi

Re: [Tinycc-devel] arm-asm breaks aarch64 (as with Fedora 33 on RPi)

2021-01-03 Thread Danny Milosavljevic
Hi Herman, you committed a patch enabling all ARM 32 bit assembly tokens on aarch64. Just a heads-up that you have to mode switch the CPU in order to be able to execute ARM 32 bit machine code on aarch64. I mean the tokens alone are not that bad (they aren't functionality), but the functionality

Re: [Tinycc-devel] arm-asm breaks aarch64 (as with Fedora 33 on RPi)

2021-01-03 Thread Christian Jullien
Hello, I confirm it is fixed except, probably not related to you commits, on Aarch64 Linux using clang, I get: ./configure --strip-binaries --with-selinux --cc=clang --prefix=/home/jullien/tinycc/static dlltest with PIC tcc: error: Unknown relocation type for got: 285 gm

Re: [Tinycc-devel] arm-asm breaks aarch64 (as with Fedora 33 on RPi)

2021-01-03 Thread Danny Milosavljevic
Hi, On Sun, 3 Jan 2021 08:47:38 +0100 "Christian Jullien" wrote: > Danny huge commit for arm code breaks aarch64 (as with Fedora 33 on RPi): > On this 64bit system, it tries to compile arm-asm: [...] > arm-asm is only valid for arm (32bit) not for arm64 (alias aarch64). In fact, on aarch64 you

[Tinycc-devel] [PATCH] arm-asm: Improve immediate error message in asm_data_processing_opcode.

2021-01-03 Thread Danny Milosavljevic
--- arm-asm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arm-asm.c b/arm-asm.c index f392f4f..fc92898 100644 --- a/arm-asm.c +++ b/arm-asm.c @@ -643,6 +643,7 @@ static void asm_data_processing_opcode(TCCState *s1, int token) immediate_value = ((immediate_value & 0x3F

[Tinycc-devel] [PATCH] arm-asm: Support shift of 0 in asm_shift_opcode

2021-01-03 Thread Danny Milosavljevic
--- arm-asm.c | 56 +-- 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/arm-asm.c b/arm-asm.c index 64588ea..f392f4f 100644 --- a/arm-asm.c +++ b/arm-asm.c @@ -433,26 +433,6 @@ static void asm_block_data_transfer_opcode(TCCState *