reg-stack.c (compare_for_stack_reg): Add bool argument.
authorUros Bizjak <ubizjak@gmail.com>
Tue, 17 Oct 2017 16:35:11 +0000 (18:35 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Tue, 17 Oct 2017 16:35:11 +0000 (18:35 +0200)
commit7061821d4aa300b600f689cadb994d7658600414
treea3619d841745f6bbd60f09336e5dcbfe8866245c
parent5a2018625a1192831f76b5bac3cb679a88947577
reg-stack.c (compare_for_stack_reg): Add bool argument.

* reg-stack.c (compare_for_stack_reg): Add bool argument.
Detect FTST instruction and handle its register pops.  Only pop
second operand if can_pop_second_op is true.
(subst_stack_regs_pat) <case COMPARE>: Detect FCOMI instruction to
set can_pop_second_op to false in the compare_for_stack_reg call.

* config/i386/i386.md (*cmpi<FPCMP:unord><MODEF:mode>): Only call
output_fp_compare for stack register operands.
* config/i386/i386.c (output_fp_compare): Do not output SSE compare
instructions here.  Do not emit stack register pops here.  Assert
that FCOMPP pops next to top stack register.  Rewrite function.

From-SVN: r253821
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.md
gcc/reg-stack.c