Re: B^HDEAD code generation (AMD64)

2023-01-09 Thread Gabriel Ravier via Gcc
On 1/10/23 01:34, Stefan Kanthak wrote: "Thomas Koenig" wrote: On 09.01.23 12:35, Stefan Kanthak wrote: 20 superfluous instructions of the total 102 instructions! The proper place for bug reports is https://gcc.gnu.org/bugzilla/ . OUCH: there's NO proper place for bugs at all! Feel free t

Re: B^HDEAD code generation (AMD64)

2023-01-09 Thread Andrew Pinski via Gcc
On Mon, Jan 9, 2023 at 4:42 PM Stefan Kanthak wrote: > > "Thomas Koenig" wrote: > > > On 09.01.23 12:35, Stefan Kanthak wrote: > >> 20 superfluous instructions of the total 102 instructions! > > > > The proper place for bug reports is https://gcc.gnu.org/bugzilla/ . > > OUCH: there's NO proper pl

Re: B^HDEAD code generation (AMD64)

2023-01-09 Thread Stefan Kanthak
"Thomas Koenig" wrote: > On 09.01.23 12:35, Stefan Kanthak wrote: >> 20 superfluous instructions of the total 102 instructions! > > The proper place for bug reports is https://gcc.gnu.org/bugzilla/ . OUCH: there's NO proper place for bugs at all! > Feel free to submit these cases there. I fee

Re: Bypass assembler when generating LTO object files

2023-01-09 Thread Martin Jambor
Hello, On Sun, Dec 18 2022, Mohamed Atef wrote: > Hello, >I am interested in working in this project during my free time, is > understanding this https://gcc.gnu.org/wiki/LinkTimeOptimization > A good starting point That section of the Wiki is very old. You may find bits there that are still

Re: Widening multiplication, but no narrowing division [i386/AMD64]

2023-01-09 Thread Stefan Kanthak
"Paul Koning" wrote: >> On Jan 9, 2023, at 10:20 AM, Stefan Kanthak wrote: >> >> "Paul Koning" wrote: >> On Jan 9, 2023, at 7:20 AM, Stefan Kanthak wrote: Hi, GCC (and other C compilers too) support the widening multiplication of i386/AMD64 processors, but DON

Re: Widening multiplication, but no narrowing division [i386/AMD64]

2023-01-09 Thread Paul Koning via Gcc
> On Jan 9, 2023, at 10:20 AM, Stefan Kanthak wrote: > > "Paul Koning" wrote: > >>> On Jan 9, 2023, at 7:20 AM, Stefan Kanthak wrote: >>> >>> Hi, >>> >>> GCC (and other C compilers too) support the widening multiplication >>> of i386/AMD64 processors, but DON'T support their narrowing div

Re: Widening multiplication, but no narrowing division [i386/AMD64]

2023-01-09 Thread Stefan Kanthak
"Paul Koning" wrote: >> On Jan 9, 2023, at 7:20 AM, Stefan Kanthak wrote: >> >> Hi, >> >> GCC (and other C compilers too) support the widening multiplication >> of i386/AMD64 processors, but DON'T support their narrowing division: > > I wonder if this changed in the recent past. > I have a pat

Re: Widening multiplication, but no narrowing division [i386/AMD64]

2023-01-09 Thread Paul Koning via Gcc
> On Jan 9, 2023, at 7:20 AM, Stefan Kanthak wrote: > > Hi, > > GCC (and other C compilers too) support the widening multiplication > of i386/AMD64 processors, but DON'T support their narrowing division: I wonder if this changed in the recent past. I have a pattern for this type of thing i

Re: Widening multiplication, but no narrowing division [i386/AMD64]

2023-01-09 Thread Stefan Kanthak
LIU Hao wrote: >在 2023/1/9 20:20, Stefan Kanthak 写道: >> Hi, >> >> GCC (and other C compilers too) support the widening multiplication >> of i386/AMD64 processors, but DON'T support their narrowing division: >> >> > > QWORD-DWORD division would change the behavior of your program. [...] > If DIV wa

Re: Widening multiplication, but no narrowing division [i386/AMD64]

2023-01-09 Thread LIU Hao via Gcc
在 2023/1/9 20:20, Stefan Kanthak 写道: Hi, GCC (and other C compilers too) support the widening multiplication of i386/AMD64 processors, but DON'T support their narrowing division: QWORD-DWORD division would change the behavior of your program. Given: ``` uint32_t xdiv(uint64_t x, uin

Widening multiplication, but no narrowing division [i386/AMD64]

2023-01-09 Thread Stefan Kanthak
Hi, GCC (and other C compilers too) support the widening multiplication of i386/AMD64 processors, but DON'T support their narrowing division: --- demo.c --- unsigned long long product(unsigned long multiplicand, unsigned long multiplier) { return (unsigned long long

Re: B^HDEAD code generation (AMD64)

2023-01-09 Thread LIU Hao via Gcc
在 2023/1/9 19:48, Thomas Koenig via Gcc 写道: On 09.01.23 12:35, Stefan Kanthak wrote: 20 superfluous instructions of the total 102 instructions! The proper place for bug reports is https://gcc.gnu.org/bugzilla/ . Feel free to submit these cases there. Created https://gcc.gnu.org/bugzilla/show

Re: B^HDEAD code generation (AMD64)

2023-01-09 Thread Thomas Koenig via Gcc
On 09.01.23 12:35, Stefan Kanthak wrote: 20 superfluous instructions of the total 102 instructions! The proper place for bug reports is https://gcc.gnu.org/bugzilla/ . Feel free to submit these cases there.

EPIC optimiser failures (i386)

2023-01-09 Thread Stefan Kanthak
Hi, compile the following routine for the i386 processor, with optimisation: --- double.c --- // IEEE-754 binary64 double-precision floating point // binary64 != ±0.0 -> 0 // binary64 == +0.0 -> +1 // binary64 == -0.0 -> -1 int plusminus0(unsigned long long binary64) { if (binary64 != -bi

B^HDEAD code generation (AMD64)

2023-01-09 Thread Stefan Kanthak
Hi, compile the following 128-bit GCD routine for the AMD64 processor with full optimization: --- gcdti3.c --- // Stein's algorithm: greatest common divisor __uint128_t __gcdti3(__uint128_t p, __uint128_t q) { unsignedr, s = 0; __uint128_t t; if (p == 0) return q; i

B^HDEAD code generation (i386)

2023-01-09 Thread Stefan Kanthak
Hi, compile the following 64-bit GCD routine for the i386 processor, with full optimization and the preprocessor macro CTZ defined: --- gcddi3.c --- // Stein's algorithm: greatest common divisor unsigned long long __gcddi3(unsigned long long p, unsigned long long q) { unsigned r, s