aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/i386/i386.md
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2000-11-27 16:23:27 +0000
committerJan Hubicka <jh@suse.cz>2000-11-27 16:23:27 +0000
commitce2c9d34bedb047d8b7164c0a74823b2261acc36 (patch)
tree821cefa05e63c8516d5446bc944351b6dd082c3a /gcc/config/i386/i386.md
parentd9587363777ac70cbe2a9148692b005698b07bf4 (diff)
* i386.c (ix86_force_to_memory, ix86_free_from_memory): New.
* i386-protos.h (ix86_force_to_memory, ix86_free_from_memory): Declare * i386.md (float?i?f, int/fp operations): Rewrite spliters to use ix86_force_to_memory and ix86_free_from_memory. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@37797 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/i386.md')
-rw-r--r--gcc/config/i386/i386.md82
1 files changed, 36 insertions, 46 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 20c6dbdfc7b..2b5d3b8161f 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -3683,39 +3683,17 @@
;; %%% Kill these when reload knows how to do it.
(define_split
[(set (match_operand 0 "register_operand" "")
- (float (match_operand:HI 1 "register_operand" "")))]
+ (float (match_operand 1 "register_operand" "")))]
"reload_completed && FLOAT_MODE_P (GET_MODE (operands[0]))"
- [(set (mem:HI (pre_dec:SI (reg:SI 7))) (match_dup 1))
- (set (match_dup 0) (match_dup 2))
- (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 2)))]
- "operands[2] = gen_rtx_FLOAT (GET_MODE (operands[0]),
- gen_rtx_MEM (HImode, stack_pointer_rtx));")
-
-(define_split
- [(set (match_operand 0 "register_operand" "")
- (float (match_operand:SI 1 "register_operand" "")))]
- "reload_completed && FLOAT_MODE_P (GET_MODE (operands[0]))"
- [(set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 1))
- (set (match_dup 0) (match_dup 2))
- (parallel [(set (match_dup 1) (mem:SI (reg:SI 7)))
- (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])]
- "operands[2] = gen_rtx_FLOAT (GET_MODE (operands[0]),
- gen_rtx_MEM (SImode, stack_pointer_rtx));")
-
-(define_split
- [(set (match_operand 0 "register_operand" "")
- (float (match_operand:DI 1 "nonmemory_operand" "")))]
- "reload_completed && FLOAT_MODE_P (GET_MODE (operands[0]))"
- [(set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 2))
- (set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 1))
- (set (match_dup 0) (match_dup 3))
- (parallel [(set (match_dup 1) (mem:SI (reg:SI 7)))
- (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])
- (parallel [(set (match_dup 2) (mem:SI (reg:SI 7)))
- (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])]
- "split_di (operands+1, 1, operands+1, operands+2);
- operands[3] = gen_rtx_FLOAT (GET_MODE (operands[0]),
- gen_rtx_MEM (DImode, stack_pointer_rtx));")
+ [(const_int 0)]
+ "
+{
+ operands[2] = ix86_force_to_memory (GET_MODE (operands[1]), operands[1]);
+ operands[2] = gen_rtx_FLOAT (GET_MODE (operands[0]), operands[2]);
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[2]));
+ ix86_free_from_memory (GET_MODE (operands[1]));
+ DONE;
+}")
;; Add instructions
@@ -9640,13 +9618,19 @@
(match_operand 2 "register_operand" "")]))]
"TARGET_80387 && reload_completed
&& FLOAT_MODE_P (GET_MODE (operands[0]))"
- [(set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 1))
- (set (match_dup 0)
- (match_op_dup 3 [(match_dup 4) (match_dup 2)]))
- (parallel [(set (match_dup 1) (mem:SI (reg:SI 7)))
- (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])]
- "operands[4] = gen_rtx_FLOAT (GET_MODE (operands[0]),
- gen_rtx_MEM (SImode, stack_pointer_rtx));")
+ [(const_int 0)]
+ "
+{
+ operands[4] = ix86_force_to_memory (GET_MODE (operands[1]), operands[1]);
+ operands[4] = gen_rtx_FLOAT (GET_MODE (operands[0]), operands[4]);
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_fmt_ee (GET_CODE (operands[3]),
+ GET_MODE (operands[3]),
+ operands[4],
+ operands[2])));
+ ix86_free_from_memory (GET_MODE (operands[1]));
+ DONE;
+}")
(define_split
[(set (match_operand 0 "register_operand" "")
@@ -9655,13 +9639,19 @@
(float (match_operand:SI 2 "register_operand" ""))]))]
"TARGET_80387 && reload_completed
&& FLOAT_MODE_P (GET_MODE (operands[0]))"
- [(set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 2))
- (set (match_dup 0)
- (match_op_dup 3 [(match_dup 1) (match_dup 4)]))
- (parallel [(set (match_dup 2) (mem:SI (reg:SI 7)))
- (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])]
- "operands[4] = gen_rtx_FLOAT (GET_MODE (operands[0]),
- gen_rtx_MEM (SImode, stack_pointer_rtx));")
+ [(const_int 0)]
+ "
+{
+ operands[4] = ix86_force_to_memory (GET_MODE (operands[2]), operands[2]);
+ operands[4] = gen_rtx_FLOAT (GET_MODE (operands[0]), operands[4]);
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_fmt_ee (GET_CODE (operands[3]),
+ GET_MODE (operands[3]),
+ operands[1],
+ operands[4])));
+ ix86_free_from_memory (GET_MODE (operands[2]));
+ DONE;
+}")
;; FPU special functions.