diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-25 12:53:44 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-25 12:53:44 +0000 |
commit | 2fa792d7a81d9215bf4a1b7e8f305b8b208dcf2e (patch) | |
tree | a4bf9453290b36a89996ebbd090aa3032a51500f /gcc/reg-stack.c | |
parent | 0916e371e9077975bf0802e079e586122be783e8 (diff) | |
download | gcc-2fa792d7a81d9215bf4a1b7e8f305b8b208dcf2e.tar.gz |
* reg-stack.c (subst_stack_regs_pat): Swap operands in commutative
operations when needed.
* i386.md (fop_?f_comm): New.
(fop_?f_1): Do not accept commutative operands.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30664 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reg-stack.c')
-rw-r--r-- | gcc/reg-stack.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 98b87786745..aa2b01010f6 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -1631,6 +1631,16 @@ subst_stack_regs_pat (insn, regstack, pat) SET_HARD_REG_BIT (regstack->reg_set, REGNO (*dest)); replace_reg (dest, get_hard_regnum (regstack, *dest)); } + + /* Keep operand 1 maching with destination. */ + if (GET_RTX_CLASS (GET_CODE (pat_src)) == 'c' + && REG_P (*src1) && REG_P (*src2) + && REGNO (*src1) != REGNO (*dest)) + { + rtx tmp = *src1; + *src1 = *src2; + *src2 = tmp; + } break; case UNSPEC: |