From 87aa52463bfcff18f2fd26590112107b0f9656dc Mon Sep 17 00:00:00 2001 From: John Wehle Date: Fri, 2 Apr 1999 11:18:47 +0000 Subject: [PATCH] i386.md: Delete floating point compare... * i386.md: Delete floating point compare, add, subtract, multiply, and divide patterns which allowed integer operands. * i386.c (output_386_binary_op): Delete unused code. (output_float_compare): Likewise. From-SVN: r26123 --- gcc/ChangeLog | 8 ++ gcc/config/i386/i386.c | 60 +++----------- gcc/config/i386/i386.md | 172 +--------------------------------------- 3 files changed, 18 insertions(+), 222 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 437230aa8e87..fe327faac92e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Fri Apr 2 14:12:06 EST 1999 John Wehle (john@feith.com) + + * i386.md: Delete floating point compare, add, subtract, + multiply, and divide patterns which allowed integer + operands. + * i386.c (output_386_binary_op): Delete unused code. + (output_float_compare): Likewise. + Fri Apr 2 11:53:37 1999 John Wehle (john@feith.com) * i386.md (movsf+1, movdf+1, movxf+1): Update constraints diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index c45efe56c80f..f7738818656d 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4187,35 +4187,19 @@ output_387_binary_op (insn, operands) switch (GET_CODE (operands[3])) { case PLUS: - if (GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT - || GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT) - base_op = "fiadd"; - else - base_op = "fadd"; + base_op = "fadd"; break; case MINUS: - if (GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT - || GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT) - base_op = "fisub"; - else - base_op = "fsub"; + base_op = "fsub"; break; case MULT: - if (GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT - || GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT) - base_op = "fimul"; - else - base_op = "fmul"; + base_op = "fmul"; break; case DIV: - if (GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT - || GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT) - base_op = "fidiv"; - else - base_op = "fdiv"; + base_op = "fdiv"; break; default: @@ -4238,17 +4222,8 @@ output_387_binary_op (insn, operands) if (GET_CODE (operands[2]) == MEM) return strcat (buf, AS1 (%z2,%2)); - if (NON_STACK_REG_P (operands[1])) - { - output_op_from_reg (operands[1], strcat (buf, AS1 (%z0,%1))); - return ""; - } - - else if (NON_STACK_REG_P (operands[2])) - { - output_op_from_reg (operands[2], strcat (buf, AS1 (%z0,%1))); - return ""; - } + if (! STACK_REG_P (operands[1]) || ! STACK_REG_P (operands[2])) + abort (); if (find_regno_note (insn, REG_DEAD, REGNO (operands[2]))) { @@ -4271,18 +4246,6 @@ output_387_binary_op (insn, operands) if (GET_CODE (operands[2]) == MEM) return strcat (buf, AS1 (%z2,%2)); - if (NON_STACK_REG_P (operands[1])) - { - output_op_from_reg (operands[1], strcat (buf, AS1 (r%z0,%1))); - return ""; - } - - else if (NON_STACK_REG_P (operands[2])) - { - output_op_from_reg (operands[2], strcat (buf, AS1 (%z0,%1))); - return ""; - } - if (! STACK_REG_P (operands[1]) || ! STACK_REG_P (operands[2])) abort (); @@ -4442,24 +4405,19 @@ output_float_compare (insn, operands) { static char buf[100]; - /* Decide if this is the integer or float compare opcode, or the - unordered float compare. */ + /* Decide if this is a float compare or an unordered float compare. */ if (unordered_compare) strcpy (buf, (cc_status.flags & CC_FCOMI) ? "fucomi" : "fucom"); - else if (GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_FLOAT) - strcpy (buf, (cc_status.flags & CC_FCOMI) ? "fcomi" : "fcom"); else - strcpy (buf, "ficom"); + strcpy (buf, (cc_status.flags & CC_FCOMI) ? "fcomi" : "fcom"); /* Modify the opcode if the 387 stack is to be popped. */ if (stack_top_dies) strcat (buf, "p"); - if (NON_STACK_REG_P (operands[1])) - output_op_from_reg (operands[1], strcat (buf, AS1 (%z0,%1))); - else if (cc_status.flags & CC_FCOMI) + if (cc_status.flags & CC_FCOMI) { output_asm_insn (strcat (buf, AS2 (%z1,%y1,%0)), operands); return ""; diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 6aaa528975e0..e5faf1d140eb 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -509,28 +509,6 @@ "* return output_float_compare (insn, operands);" [(set_attr "type" "fcompare")]) -(define_insn "" - [(set (cc0) - (match_operator 2 "VOIDmode_compare_op" - [(match_operand:XF 0 "register_operand" "f") - (float:XF - (match_operand:SI 1 "nonimmediate_operand" "rm"))])) - (clobber (match_scratch:HI 3 "=a"))] - "TARGET_80387" - "* return output_float_compare (insn, operands);" - [(set_attr "type" "fcompare")]) - -(define_insn "" - [(set (cc0) - (match_operator 2 "VOIDmode_compare_op" - [(float:XF - (match_operand:SI 0 "nonimmediate_operand" "rm")) - (match_operand:XF 1 "register_operand" "f")])) - (clobber (match_scratch:HI 3 "=a"))] - "TARGET_80387" - "* return output_float_compare (insn, operands);" - [(set_attr "type" "fcompare")]) - (define_insn "" [(set (cc0) (match_operator 2 "VOIDmode_compare_op" @@ -595,28 +573,6 @@ "* return output_float_compare (insn, operands);" [(set_attr "type" "fcompare")]) -(define_insn "" - [(set (cc0) - (match_operator 2 "VOIDmode_compare_op" - [(match_operand:DF 0 "register_operand" "f") - (float:DF - (match_operand:SI 1 "nonimmediate_operand" "rm"))])) - (clobber (match_scratch:HI 3 "=a"))] - "TARGET_80387" - "* return output_float_compare (insn, operands);" - [(set_attr "type" "fcompare")]) - -(define_insn "" - [(set (cc0) - (match_operator 2 "VOIDmode_compare_op" - [(float:DF - (match_operand:SI 0 "nonimmediate_operand" "rm")) - (match_operand:DF 1 "register_operand" "f")])) - (clobber (match_scratch:HI 3 "=a"))] - "TARGET_80387" - "* return output_float_compare (insn, operands);" - [(set_attr "type" "fcompare")]) - (define_insn "" [(set (cc0) (match_operator 2 "VOIDmode_compare_op" @@ -690,28 +646,6 @@ "* return output_float_compare (insn, operands);" [(set_attr "type" "fcompare")]) -(define_insn "" - [(set (cc0) - (match_operator 2 "VOIDmode_compare_op" - [(match_operand:SF 0 "register_operand" "f") - (float:SF - (match_operand:SI 1 "nonimmediate_operand" "rm"))])) - (clobber (match_scratch:HI 3 "=a"))] - "TARGET_80387" - "* return output_float_compare (insn, operands);" - [(set_attr "type" "fcompare")]) - -(define_insn "" - [(set (cc0) - (match_operator 2 "VOIDmode_compare_op" - [(float:SF - (match_operand:SI 0 "nonimmediate_operand" "rm")) - (match_operand:SF 1 "register_operand" "f")])) - (clobber (match_scratch:HI 3 "=a"))] - "TARGET_80387" - "* return output_float_compare (insn, operands);" - [(set_attr "type" "fcompare")]) - (define_insn "" [(set (cc0) (compare:CCFPEQ (match_operand:SF 0 "register_operand" "f") @@ -6986,9 +6920,7 @@ byte_xor_operation: ;; mulM3 and divM3. There are three patterns for each of DFmode and ;; SFmode. The first is the normal insn, the second the same insn but ;; with one operand a conversion, and the third the same insn but with -;; the other operand a conversion. The conversion may be SFmode or -;; SImode if the target mode DFmode, but only SImode if the target mode -;; is SFmode. +;; the other operand a conversion. (define_insn "" [(set (match_operand:DF 0 "register_operand" "=f,f") @@ -7007,23 +6939,6 @@ byte_xor_operation: ) )]) -(define_insn "" - [(set (match_operand:DF 0 "register_operand" "=f") - (match_operator:DF 3 "binary_387_op" - [(float:DF (match_operand:SI 1 "nonimmediate_operand" "rm")) - (match_operand:DF 2 "register_operand" "0")]))] - "TARGET_80387" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:DF 3 "is_mul" "") - (const_string "fpmul") - (match_operand:DF 3 "is_div" "") - (const_string "fpdiv") - ] - (const_string "fpop") - ) - )]) - (define_insn "" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_387_op" @@ -7041,23 +6956,6 @@ byte_xor_operation: ) )]) -(define_insn "" - [(set (match_operand:XF 0 "register_operand" "=f") - (match_operator:XF 3 "binary_387_op" - [(float:XF (match_operand:SI 1 "nonimmediate_operand" "rm")) - (match_operand:XF 2 "register_operand" "0")]))] - "TARGET_80387" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:DF 3 "is_mul" "") - (const_string "fpmul") - (match_operand:DF 3 "is_div" "") - (const_string "fpdiv") - ] - (const_string "fpop") - ) - )]) - (define_insn "" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_387_op" @@ -7075,23 +6973,6 @@ byte_xor_operation: ) )]) -(define_insn "" - [(set (match_operand:XF 0 "register_operand" "=f") - (match_operator:XF 3 "binary_387_op" - [(match_operand:XF 1 "register_operand" "0") - (float:XF (match_operand:SI 2 "nonimmediate_operand" "rm"))]))] - "TARGET_80387" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:DF 3 "is_mul" "") - (const_string "fpmul") - (match_operand:DF 3 "is_div" "") - (const_string "fpdiv") - ] - (const_string "fpop") - ) - )]) - (define_insn "" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_387_op" @@ -7127,23 +7008,6 @@ byte_xor_operation: ) )]) -(define_insn "" - [(set (match_operand:DF 0 "register_operand" "=f") - (match_operator:DF 3 "binary_387_op" - [(match_operand:DF 1 "register_operand" "0") - (float:DF (match_operand:SI 2 "nonimmediate_operand" "rm"))]))] - "TARGET_80387" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:DF 3 "is_mul" "") - (const_string "fpmul") - (match_operand:DF 3 "is_div" "") - (const_string "fpdiv") - ] - (const_string "fpop") - ) - )]) - (define_insn "" [(set (match_operand:DF 0 "register_operand" "=f,f") (match_operator:DF 3 "binary_387_op" @@ -7178,40 +7042,6 @@ byte_xor_operation: (const_string "fpop") ) )]) - -(define_insn "" - [(set (match_operand:SF 0 "register_operand" "=f") - (match_operator:SF 3 "binary_387_op" - [(float:SF (match_operand:SI 1 "nonimmediate_operand" "rm")) - (match_operand:SF 2 "register_operand" "0")]))] - "TARGET_80387" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:DF 3 "is_mul" "") - (const_string "fpmul") - (match_operand:DF 3 "is_div" "") - (const_string "fpdiv") - ] - (const_string "fpop") - ) - )]) - -(define_insn "" - [(set (match_operand:SF 0 "register_operand" "=f") - (match_operator:SF 3 "binary_387_op" - [(match_operand:SF 1 "register_operand" "0") - (float:SF (match_operand:SI 2 "nonimmediate_operand" "rm"))]))] - "TARGET_80387" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:DF 3 "is_mul" "") - (const_string "fpmul") - (match_operand:DF 3 "is_div" "") - (const_string "fpdiv") - ] - (const_string "fpop") - ) - )]) (define_expand "strlensi" [(parallel [(set (match_dup 4) -- 2.43.5