censored naked SSE reciprocals, -mrecip

Uros Bizjak ubizjak@gmail.com
Sat Dec 29 18:05:00 GMT 2007


> i lately had some use for -mrecip but it turned out to come with all
> sorts of strings attached and apparently no opt-out. Briefly, barring
> inline asm, i can't get gcc to emit those ops without a NR fixup.


> Questions:
>   a) is that really by design?


Attached patch fixes these problems by using correct shortcuts when 
generating intrinsic functions.

2007-12-29  Uros Bizjak  <ubizjak@gmail.com>

        * config/i386/sse.md ("*divv4sf3"): Rename to "sse_divv4sf3".
        ("*sse_rsqrtv4sf2"): Export.
        ("*sse_sqrtv4sf2"): Ditto.
        * config/i386/i386.c (enum ix86_builtins) [IX86_BUILTIN_RSQRTPS_NR,
        IX86_BUILTIN_SQRTPS_NR]: New constants.
        (struct builtin_description) [IX86_BUILTIN_DIVPS]: Use
        [IX86_BUILTIN_SQRTPS]: Use CODE_FOR_sse_sqrtv4sf2.
        [IX86_BUILTIN_SQRTPS_NR]: New.
        [IX86_BUILTIN_RSQRTPS_NR]: Ditto.
        (ix86_init_mmx_sse_builtins): Initialize 
__builtin_ia32_rsqrtps_nr and
        (ix86_builtin_vectorized_function): Convert BUILT_IN_SQRTF to
        (ix86_builtin_reciprocal): Convert IX86_BUILTIN_SQRTPS_NR to

Patch was bootstrapped and regression tested with {,-m32} on 
x86_64-pc-linux-gnu. Patch is committed to SVN.

Thanks a lot for your report,
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: r.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20071229/a58d644d/attachment.txt>

More information about the Gcc-patches mailing list