From bc725565dfd2f7d764fd852906770119f0e85ae7 Mon Sep 17 00:00:00 2001 From: John Wehle Date: Fri, 2 Apr 1999 21:58:42 +0000 Subject: i386.md (floatsisf2, [...]): Rewrite using a splitter. * i386.md (floatsisf2, floatdisf2, floatsidf2, floatdidf2, floatsixf2, floatdixf2): Rewrite using a splitter. From-SVN: r26145 --- gcc/ChangeLog | 5 + gcc/config/i386/i386.md | 311 ++++++++++++++++++++++++++++++++---------------- 2 files changed, 213 insertions(+), 103 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 21afe87..27384c1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Sat Apr 3 00:53:29 EST 1999 John Wehle (john@feith.com) + + * i386.md (floatsisf2, floatdisf2, floatsidf2, floatdidf2, + floatsixf2, floatdixf2): Rewrite using a splitter. + Fri Apr 2 17:36:10 1999 Nick Clifton * config/arm/arm.c (arm_print_operand): Print large constants in diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index e5faf1d..d434366 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -2614,149 +2614,254 @@ "* return output_fix_trunc (insn, operands);") ;; Conversion between fixed point and floating point. -;; The actual pattern that matches these is at the end of this file. ;; ??? Possibly represent floatunssidf2 here in gcc2. (define_expand "floatsisf2" - [(set (match_operand:SF 0 "register_operand" "") - (float:SF (match_operand:SI 1 "nonimmediate_operand" "")))] + [(parallel [(set (match_operand:SF 0 "register_operand" "") + (float:SF (match_operand:SI 1 "nonimmediate_operand" ""))) + (clobber (match_dup 2))])] + "TARGET_80387" + "operands[2] = assign_386_stack_local (SImode, 0);") + +(define_insn "" + [(set (match_operand:SF 0 "register_operand" "=f,f") + (float:SF (match_operand:SI 1 "nonimmediate_operand" "m,!r"))) + (clobber (match_operand:SI 2 "memory_operand" "m,m"))] "TARGET_80387" + "#") + +(define_split + [(set (match_operand:SF 0 "register_operand" "=f") + (float:SF (match_operand:SI 1 "memory_operand" "m"))) + (clobber (match_operand:SI 2 "memory_operand" "m"))] + "TARGET_80387 && reload_completed" + [(set (match_dup 0) + (float:SF (match_dup 1)))] + "") + +(define_split + [(set (match_operand:SF 0 "register_operand" "=f") + (float:SF (match_operand:SI 1 "register_operand" "r"))) + (clobber (match_operand:SI 2 "memory_operand" "m"))] + "TARGET_80387 && reload_completed" + [(set (match_dup 2) + (match_dup 1)) + (set (match_dup 0) + (float:SF (match_dup 2)))] "") +(define_insn "" + [(set (match_operand:SF 0 "register_operand" "=f") + (float:SF (match_operand:SI 1 "memory_operand" "m")))] + "TARGET_80387" + "* return AS1 (fild%z1,%1);" + [(set_attr "type" "fpop")]) + (define_expand "floatdisf2" - [(set (match_operand:SF 0 "register_operand" "") - (float:SF (match_operand:DI 1 "nonimmediate_operand" "")))] + [(parallel [(set (match_operand:SF 0 "register_operand" "") + (float:SF (match_operand:DI 1 "nonimmediate_operand" ""))) + (clobber (match_dup 2))])] "TARGET_80387" - "") + "operands[2] = assign_386_stack_local (DImode, 0);") -(define_expand "floatsidf2" - [(set (match_operand:DF 0 "register_operand" "") - (float:DF (match_operand:SI 1 "nonimmediate_operand" "")))] +(define_insn "" + [(set (match_operand:SF 0 "register_operand" "=f,f") + (float:SF (match_operand:DI 1 "nonimmediate_operand" "m,!r"))) + (clobber (match_operand:DI 2 "memory_operand" "m,o"))] "TARGET_80387" + "#") + +(define_split + [(set (match_operand:SF 0 "register_operand" "=f") + (float:SF (match_operand:DI 1 "memory_operand" "m"))) + (clobber (match_operand:DI 2 "memory_operand" "m"))] + "TARGET_80387 && reload_completed" + [(set (match_dup 0) + (float:SF (match_dup 1)))] "") -(define_expand "floatdidf2" - [(set (match_operand:DF 0 "register_operand" "") - (float:DF (match_operand:DI 1 "nonimmediate_operand" "")))] - "TARGET_80387" +(define_split + [(set (match_operand:SF 0 "register_operand" "=f") + (float:SF (match_operand:DI 1 "register_operand" "r"))) + (clobber (match_operand:DI 2 "memory_operand" "o"))] + "TARGET_80387 && reload_completed" + [(set (match_dup 2) + (match_dup 1)) + (set (match_dup 0) + (float:SF (match_dup 2)))] "") -(define_expand "floatsixf2" - [(set (match_operand:XF 0 "register_operand" "") - (float:XF (match_operand:SI 1 "nonimmediate_operand" "")))] +(define_insn "" + [(set (match_operand:SF 0 "register_operand" "=f") + (float:SF (match_operand:DI 1 "memory_operand" "m")))] + "TARGET_80387" + "* return AS1 (fild%z1,%1);" + [(set_attr "type" "fpop")]) + +(define_expand "floatsidf2" + [(parallel [(set (match_operand:DF 0 "register_operand" "") + (float:DF (match_operand:SI 1 "nonimmediate_operand" ""))) + (clobber (match_dup 2))])] "TARGET_80387" + "operands[2] = assign_386_stack_local (SImode, 0);") + +(define_insn "" + [(set (match_operand:DF 0 "register_operand" "=f,f") + (float:DF (match_operand:SI 1 "nonimmediate_operand" "m,!r"))) + (clobber (match_operand:SI 2 "memory_operand" "m,m"))] + "TARGET_80387" + "#") + +(define_split + [(set (match_operand:DF 0 "register_operand" "=f") + (float:DF (match_operand:SI 1 "memory_operand" "m"))) + (clobber (match_operand:SI 2 "memory_operand" "m"))] + "TARGET_80387 && reload_completed" + [(set (match_dup 0) + (float:DF (match_dup 1)))] "") -(define_expand "floatdixf2" - [(set (match_operand:XF 0 "register_operand" "") - (float:XF (match_operand:DI 1 "nonimmediate_operand" "")))] - "TARGET_80387 && LONG_DOUBLE_TYPE_SIZE == 96" +(define_split + [(set (match_operand:DF 0 "register_operand" "=f") + (float:DF (match_operand:SI 1 "register_operand" "r"))) + (clobber (match_operand:SI 2 "memory_operand" "m"))] + "TARGET_80387 && reload_completed" + [(set (match_dup 2) + (match_dup 1)) + (set (match_dup 0) + (float:DF (match_dup 2)))] "") -;; This will convert from SImode or DImode to MODE_FLOAT. +(define_insn "" + [(set (match_operand:DF 0 "register_operand" "=f") + (float:DF (match_operand:SI 1 "memory_operand" "m")))] + "TARGET_80387" + "* return AS1 (fild%z1,%1);" + [(set_attr "type" "fpop")]) + +(define_expand "floatdidf2" + [(parallel [(set (match_operand:DF 0 "register_operand" "") + (float:DF (match_operand:DI 1 "nonimmediate_operand" ""))) + (clobber (match_dup 2))])] + "TARGET_80387" + "operands[2] = assign_386_stack_local (DImode, 0);") (define_insn "" - [(set (match_operand:XF 0 "register_operand" "=f") - (float:XF (match_operand:DI 1 "nonimmediate_operand" "rm")))] + [(set (match_operand:DF 0 "register_operand" "=f,f") + (float:DF (match_operand:DI 1 "nonimmediate_operand" "m,!r"))) + (clobber (match_operand:DI 2 "memory_operand" "m,o"))] "TARGET_80387" - "* -{ - if (NON_STACK_REG_P (operands[1])) - { - output_op_from_reg (operands[1], AS1 (fild%z0,%1)); - RET; - } - else if (GET_CODE (operands[1]) == MEM) - return AS1 (fild%z1,%1); - else - abort (); -}") + "#") + +(define_split + [(set (match_operand:DF 0 "register_operand" "=f") + (float:DF (match_operand:DI 1 "memory_operand" "m"))) + (clobber (match_operand:DI 2 "memory_operand" "m"))] + "TARGET_80387 && reload_completed" + [(set (match_dup 0) + (float:DF (match_dup 1)))] + "") + +(define_split + [(set (match_operand:DF 0 "register_operand" "=f") + (float:DF (match_operand:DI 1 "register_operand" "r"))) + (clobber (match_operand:DI 2 "memory_operand" "o"))] + "TARGET_80387 && reload_completed" + [(set (match_dup 2) + (match_dup 1)) + (set (match_dup 0) + (float:DF (match_dup 2)))] + "") (define_insn "" [(set (match_operand:DF 0 "register_operand" "=f") - (float:DF (match_operand:DI 1 "nonimmediate_operand" "rm")))] + (float:DF (match_operand:DI 1 "memory_operand" "m")))] "TARGET_80387" - "* -{ - if (NON_STACK_REG_P (operands[1])) - { - output_op_from_reg (operands[1], AS1 (fild%z0,%1)); - RET; - } - else if (GET_CODE (operands[1]) == MEM) - return AS1 (fild%z1,%1); - else - abort (); -}") + "* return AS1 (fild%z1,%1);" + [(set_attr "type" "fpop")]) + +(define_expand "floatsixf2" + [(parallel [(set (match_operand:XF 0 "register_operand" "") + (float:XF (match_operand:SI 1 "nonimmediate_operand" ""))) + (clobber (match_dup 2))])] + "TARGET_80387" + "operands[2] = assign_386_stack_local (SImode, 0);") (define_insn "" - [(set (match_operand:SF 0 "register_operand" "=f") - (float:SF (match_operand:DI 1 "nonimmediate_operand" "rm")))] + [(set (match_operand:XF 0 "register_operand" "=f,f") + (float:XF (match_operand:SI 1 "nonimmediate_operand" "m,!r"))) + (clobber (match_operand:SI 2 "memory_operand" "m,m"))] "TARGET_80387" - "* -{ - if (NON_STACK_REG_P (operands[1])) - { - output_op_from_reg (operands[1], AS1 (fild%z0,%1)); - RET; - } - else if (GET_CODE (operands[1]) == MEM) - return AS1 (fild%z1,%1); - else - abort (); -}") + "#") + +(define_split + [(set (match_operand:XF 0 "register_operand" "=f") + (float:XF (match_operand:SI 1 "memory_operand" "m"))) + (clobber (match_operand:SI 2 "memory_operand" "m"))] + "TARGET_80387 && reload_completed" + [(set (match_dup 0) + (float:XF (match_dup 1)))] + "") + +(define_split + [(set (match_operand:XF 0 "register_operand" "=f") + (float:XF (match_operand:SI 1 "register_operand" "r"))) + (clobber (match_operand:SI 2 "memory_operand" "m"))] + "TARGET_80387 && reload_completed" + [(set (match_dup 2) + (match_dup 1)) + (set (match_dup 0) + (float:XF (match_dup 2)))] + "") (define_insn "" - [(set (match_operand:DF 0 "register_operand" "=f") - (float:DF (match_operand:SI 1 "nonimmediate_operand" "rm")))] + [(set (match_operand:XF 0 "register_operand" "=f") + (float:XF (match_operand:SI 1 "memory_operand" "m")))] "TARGET_80387" - "* -{ - if (NON_STACK_REG_P (operands[1])) - { - output_op_from_reg (operands[1], AS1 (fild%z0,%1)); - RET; - } - else if (GET_CODE (operands[1]) == MEM) - return AS1 (fild%z1,%1); - else - abort (); -}") + "* return AS1 (fild%z1,%1);" + [(set_attr "type" "fpop")]) + +(define_expand "floatdixf2" + [(parallel [(set (match_operand:XF 0 "register_operand" "") + (float:XF (match_operand:DI 1 "nonimmediate_operand" ""))) + (clobber (match_dup 2))])] + "TARGET_80387" + "operands[2] = assign_386_stack_local (DImode, 0);") (define_insn "" [(set (match_operand:XF 0 "register_operand" "=f,f") - (float:XF (match_operand:SI 1 "nonimmediate_operand" "m,!*r")))] + (float:XF (match_operand:DI 1 "nonimmediate_operand" "m,!r"))) + (clobber (match_operand:DI 2 "memory_operand" "m,o"))] "TARGET_80387" - "* -{ - if (NON_STACK_REG_P (operands[1])) - { - output_op_from_reg (operands[1], AS1 (fild%z0,%1)); - RET; - } - else if (GET_CODE (operands[1]) == MEM) - return AS1 (fild%z1,%1); - else - abort (); -}") + "#") + +(define_split + [(set (match_operand:XF 0 "register_operand" "=f") + (float:XF (match_operand:DI 1 "memory_operand" "m"))) + (clobber (match_operand:DI 2 "memory_operand" "m"))] + "TARGET_80387 && reload_completed" + [(set (match_dup 0) + (float:XF (match_dup 1)))] + "") + +(define_split + [(set (match_operand:XF 0 "register_operand" "=f") + (float:XF (match_operand:DI 1 "register_operand" "r"))) + (clobber (match_operand:DI 2 "memory_operand" "o"))] + "TARGET_80387 && reload_completed" + [(set (match_dup 2) + (match_dup 1)) + (set (match_dup 0) + (float:XF (match_dup 2)))] + "") (define_insn "" - [(set (match_operand:SF 0 "register_operand" "=f") - (float:SF (match_operand:SI 1 "nonimmediate_operand" "rm")))] + [(set (match_operand:XF 0 "register_operand" "=f") + (float:XF (match_operand:DI 1 "memory_operand" "m")))] "TARGET_80387" - "* -{ - if (NON_STACK_REG_P (operands[1])) - { - output_op_from_reg (operands[1], AS1 (fild%z0,%1)); - RET; - } - else if (GET_CODE (operands[1]) == MEM) - return AS1 (fild%z1,%1); - else - abort (); -}") + "* return AS1 (fild%z1,%1);" + [(set_attr "type" "fpop")]) ;;- add instructions -- cgit v1.1