On Wed, Sep 06, 2017 at 11:54:38PM +0200, Patrick Wildt wrote:
> On Wed, Sep 06, 2017 at 11:43:15PM +0200, Christian Weisgerber wrote:
> > Somebody noticed this on FreeBSD:
> > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221733
> > 
> > On i386, libcompiler_rt includes assembly implementations for
> > floating point conversion functions that unconditionally use SSE2
> > instructions, which are not supported by older CPUs.  Specifically,
> > these files:
> > 
> > floatdidf.S
> > floatdisf.S
> > floatdixf.S
> > floatundidf.S
> > floatundisf.S
> > floatundixf.S
> > 
> > We need to use the generic C implementation instead.  The way the
> > Makefile is currently set up, I guess we would just delete the
> > affected files under lib/libcompiler_rt/i386/?
> > 
> > -- 
> > Christian "naddy" Weisgerber                          na...@mips.inka.de
> > 
> 
> Maybe this would already help?  Would at least not throw stones into the
> way of the next person doing an upgrade of compiler-rt...
> 
> Patrick
> 
> diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile
> index f82c8156c2f..070b6e7cbde 100644
> --- a/lib/libcompiler_rt/Makefile
> +++ b/lib/libcompiler_rt/Makefile
> @@ -89,17 +89,11 @@ GEN_SRCS= absvdi2 \
>               fixunsxfti \
>               fixxfdi \
>               fixxfti \
> -             floatdidf \
> -             floatdisf \
> -             floatdixf \
>               floatsidf \
>               floatsisf \
>               floattidf \
>               floattisf \
>               floattixf \
> -             floatundidf \
> -             floatundisf \
> -             floatundixf \
>               floatunsidf \
>               floatunsisf \
>               floatuntidf \
> @@ -165,6 +159,22 @@ GEN_SRCS=        absvdi2 \
>               umodsi3 \
>               umodti3
>  
> +.if ${RTARCH} == "i386"
> +SRCS+=       floatdidf.c \
> +     floatdisf.c \
> +     floatdixf.c.c \
> +     floatundidf.c \
> +     floatundisf.c \
> +     floatundixf.c
> +.else
> +GEN_SRCS+=   floatdidf \
> +             floatdisf \
> +             floatdixf \
> +             floatundidf \
> +             floatundisf \
> +             floatundixf
> +.endif
> +
>  .for file in ${GEN_SRCS}
>  .    if exists(${.CURDIR}/${RTARCH}/${file}.S)
>  SRCS+=       ${file}.S
> 

this looks ok to me. I can run at least a build test later, but I don't
have any hardware that lacks these instructions.

-ml

Reply via email to