This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v2, middle-end/i386]: Fix PR88502, Inline built-in asinh, acosh, atanh for -ffast-math

On Mon, Dec 17, 2018 at 9:26 AM Richard Biener <> wrote:
> On Mon, 17 Dec 2018, Uros Bizjak wrote:
> > ... and the patch.
> middle-end parts are OK.
> > On Mon, Dec 17, 2018 at 8:58 AM Uros Bizjak <> wrote:
> > >
> > > Attached patch inlines calls to asinh{,f}, acosh{,f,l} and atanh{,f,l}
> > > using x87 XFmode arithmetic. In the patch, I left out asinhl due to
> > > its reduced input argument range, but perhaps it could be added back,
> > > since we are expanding under flag_unsafe_math_optimizations. The
> > > expanders are modelled after the removed inlines in glibc [1] (which
> > > also include asinhl, with a comment mentioning its reduced input
> > > argument range).

Thinking a bit more about reduced input range of asinhl - we have
similar situation with other trigonometric functions, where argument
range is reduced to +-2^63. So, I have committed version 2 of the
patch, which also expands asinhl.

2018-12-17  Uros Bizjak  <>

    PR target/88502
    * internal-fn.def (ACOSH): New.
    (ASINH): Ditto.
    (ATANH): Ditto.
    * optabs.def (acosh_optab): New.
    (asinh_optab): Ditto.
    (atanh_optab): Ditto.
    * config/i386/i386-protos.h (ix86_emit_i387_asinh): New prototype.
    (ix86_emit_i387_acosh): Ditto.
    (ix86_emit_i387_atanh): Ditto.
    * config/i386/i386.c (ix86_emit_i387_asinh): New function.
    (ix86_emit_i387_acosh): Ditto.
    (ix86_emit_i387_atanh): Ditto.
    * config/i386/ (asinhxf2): New expander.
    (asinh<mode>2):    Ditto.
    (acoshxf2): Ditto.
    (acosh<mode>2): Ditto.
    (atanhxf2): Ditto.
    (atanh<mode>2): Ditto.


Attachment: p.diff.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]