Bug#894840: clang: baseline cpu violation on i386

2018-11-28 Thread Sylvestre Ledru



Le 28/11/2018 à 00:01, Fanael Linithien a écrit :

On Wed, 4 Apr 2018 22:08:16 +0200 Sylvestre Ledru  wrote:

As this has been the case for a long time, it shows that it isn't a severe 
issue.

It's not a severe issue because it's easy to fix/work around: just
passing -march=i686 to Clang is enough. I was never hit by this
problem because I'm in the habit of passing the pertinent -march to
the compiler always, so I'm not affected by compiler defaults.

Besides, this behavior is the upstream default anyway.

Yeah, I was incorrect with your bug. This new bug is because I moved to 
use llvm-toolchain-7 using a stage2 build method.


So, all llvm binaries are impacted.

I will work on a fix in the next few days

S



Bug#894840: clang: baseline cpu violation on i386

2018-11-27 Thread Fanael Linithien
On Wed, 4 Apr 2018 22:08:16 +0200 Sylvestre Ledru  wrote:
> As this has been the case for a long time, it shows that it isn't a severe 
> issue.

It's not a severe issue because it's easy to fix/work around: just
passing -march=i686 to Clang is enough. I was never hit by this
problem because I'm in the habit of passing the pertinent -march to
the compiler always, so I'm not affected by compiler defaults.

Besides, this behavior is the upstream default anyway.



Bug#894840: clang: baseline cpu violation on i386

2018-04-04 Thread Sylvestre Ledru
severity 894840 normal
thanks

Hello,

On 04/04/2018 20:36, Andreas Beckmann wrote:
> Package: clang
> Version: baseline cpu violation on i386
> Severity: serious
> 
> Hi,
> 
> all clang versions (at least since wheezy) by default generate code for
> a cpu that is newer than the baseline cpu on i386. On clang-6.0 the
> default is apparently pentium4 which has sse2 (among other features),
> but that is not available on the baseline cpu, which is currently i686.
Sorry about that but this is by design and I am not planning to work on fixing 
that...

As this has been the case for a long time, it shows that it isn't a severe 
issue.

I think we (Debian) should instead have a discussion on having SSE2 as minimal 
req for intel-like cpu.
Other projects like Firefox or Chrome are making that a requirement too.

Cheers,
Sylvestre



Bug#894840: clang: baseline cpu violation on i386

2018-04-04 Thread Andreas Beckmann
Package: clang
Version: baseline cpu violation on i386
Severity: serious

Hi,

all clang versions (at least since wheezy) by default generate code for
a cpu that is newer than the baseline cpu on i386. On clang-6.0 the
default is apparently pentium4 which has sse2 (among other features),
but that is not available on the baseline cpu, which is currently i686.

>From clang on wheezy/i386 (but the result is equivalent on newer releases
and also on amd64 with -m32) - clang generates sse code for some floating
point arithmetic, while gcc generates x87 code:

$ echo 'double fma(double a, double b, double c) { return a * b + c; }' | clang 
-O2 -S -xc - -o-
.file   "-"
.text
.globl  fma
.align  16, 0x90
.type   fma,@function
fma:# @fma
# BB#0: 
subl$12, %esp
movsd   16(%esp), %xmm0
mulsd   24(%esp), %xmm0
addsd   32(%esp), %xmm0
movsd   %xmm0, (%esp)
fldl(%esp)
addl$12, %esp
ret
.Ltmp0: 
.size   fma, .Ltmp0-fma


.section".note.GNU-stack","",@progbits

$ echo 'double fma(double a, double b, double c) { return a * b + c; }' | gcc 
-O2 -S -xc - -o-
.file   ""
.text
.p2align 4,,15
.globl  fma
.type   fma, @function
fma:
.LFB0:  
.cfi_startproc
fldl12(%esp)
fmull   4(%esp)
faddl   20(%esp)
ret
.cfi_endproc
.LFE0:  
.size   fma, .-fma
.ident  "GCC: (Debian 4.7.2-5) 4.7.2"
.section.note.GNU-stack,"",@progbits


Andreas