This is the mail archive of the gcc-patches@gcc.gnu.org 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, i386]: Re-enable FICOM instruction with IX86_FPCMP_SAHF FP comparison strategy


Hello!

"*cmp<X87MODEF:mode>_<SWI24:mode>_cc_i387" is never matched by
combine. The order of operands in x87 ficom compare is forced by
combine in simplify_comparison () function. Float operator is treated
as RTX_OBJ with a precedence over other operators and is always put in
the first place.

Patch defines TARGET_CANONICALIZE_COMPARISON target hook to swap
condition and operands to match ficom instruction.

2017-10-11  Uros Bizjak  <ubizjak@gmail.com>

    * config/i386/i386.c (ix86_canonicalize_comparison): New function.
    (TARGET_CANONICALIZE_COMPARISON): Define.

testsuite/ChangeLog:

2017-10-11  Uros Bizjak  <ubizjak@gmail.com>

    * gcc.target/i386/387-ficom-2.c: New test.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Committed to mainline SVN.

Uros.

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]