* reg-stack.c (compare_for_stack_reg): Add bool argument.
commit29603219fd996dd1fd93443e87a1831a8d79e261
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Oct 2017 16:35:11 +0000 (17 16:35 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Oct 2017 16:35:11 +0000 (17 16:35 +0000)
treea3619d841745f6bbd60f09336e5dcbfe8866245c
parent8d47c1c56c9db6161f71ae6ca2c7a8ea58245e80
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253821 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.md
gcc/reg-stack.c