"* return output_fix_trunc (insn, operands);")
\f
;; 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")])
\f
;;- add instructions