Bug#894840: clang: baseline cpu violation on i386
Andreas Beckmann
anbe at debian.org
Wed Apr 4 19:36:17 BST 2018
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, at 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","", at 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
fldl 12(%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,"", at progbits
Andreas
More information about the Pkg-llvm-team
mailing list