Commit ef903eca by Jim Wilson

(sleu+4, sleu+7, extendsftf2, extenddftf2, trunctfsf2,

trunctfdf2, floatsitf2, fix_trunctfsi2, addtf3, subtf3, multf3,
divtf3, sqrttf2): Disable when -msoft-quad-float.
(beq, bne, bgt, blt, bge, ble): When -msoft-quad-float, account
for return value of SPARC ABI routines that differs from libgcc.

From-SVN: r6752
parent 8248e2bc
...@@ -413,7 +413,7 @@ ...@@ -413,7 +413,7 @@
[(set (reg:CCFPE 0) [(set (reg:CCFPE 0)
(compare:CCFPE (match_operand:TF 0 "register_operand" "f") (compare:CCFPE (match_operand:TF 0 "register_operand" "f")
(match_operand:TF 1 "register_operand" "f")))] (match_operand:TF 1 "register_operand" "f")))]
"TARGET_FPU" "TARGET_FPU && TARGET_HARD_QUAD"
"fcmpeq %0,%1" "fcmpeq %0,%1"
[(set_attr "type" "fpcmp")]) [(set_attr "type" "fpcmp")])
...@@ -437,7 +437,7 @@ ...@@ -437,7 +437,7 @@
[(set (reg:CCFP 0) [(set (reg:CCFP 0)
(compare:CCFP (match_operand:TF 0 "register_operand" "f") (compare:CCFP (match_operand:TF 0 "register_operand" "f")
(match_operand:TF 1 "register_operand" "f")))] (match_operand:TF 1 "register_operand" "f")))]
"TARGET_FPU" "TARGET_FPU && TARGET_HARD_QUAD"
"fcmpq %0,%1" "fcmpq %0,%1"
[(set_attr "type" "fpcmp")]) [(set_attr "type" "fpcmp")])
...@@ -644,6 +644,10 @@ ...@@ -644,6 +644,10 @@
;; These control RTL generation for conditional jump insns ;; These control RTL generation for conditional jump insns
;; The quad-word fp compare library routines all return nonzero to indicate
;; true, which is different from the equivalent libgcc routines, so we must
;; handle them specially here.
(define_expand "beq" (define_expand "beq"
[(set (pc) [(set (pc)
(if_then_else (eq (match_dup 1) (const_int 0)) (if_then_else (eq (match_dup 1) (const_int 0))
...@@ -651,7 +655,15 @@ ...@@ -651,7 +655,15 @@
(pc)))] (pc)))]
"" ""
" "
{ operands[1] = gen_compare_reg (EQ, sparc_compare_op0, sparc_compare_op1); }") {
if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD)
{
emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, EQ);
emit_insn (gen_bne (operands[0]));
DONE;
}
operands[1] = gen_compare_reg (EQ, sparc_compare_op0, sparc_compare_op1);
}")
(define_expand "bne" (define_expand "bne"
[(set (pc) [(set (pc)
...@@ -660,7 +672,15 @@ ...@@ -660,7 +672,15 @@
(pc)))] (pc)))]
"" ""
" "
{ operands[1] = gen_compare_reg (NE, sparc_compare_op0, sparc_compare_op1); }") {
if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD)
{
emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, NE);
emit_insn (gen_bne (operands[0]));
DONE;
}
operands[1] = gen_compare_reg (NE, sparc_compare_op0, sparc_compare_op1);
}")
(define_expand "bgt" (define_expand "bgt"
[(set (pc) [(set (pc)
...@@ -669,7 +689,15 @@ ...@@ -669,7 +689,15 @@
(pc)))] (pc)))]
"" ""
" "
{ operands[1] = gen_compare_reg (GT, sparc_compare_op0, sparc_compare_op1); }") {
if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD)
{
emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, GT);
emit_insn (gen_bne (operands[0]));
DONE;
}
operands[1] = gen_compare_reg (GT, sparc_compare_op0, sparc_compare_op1);
}")
(define_expand "bgtu" (define_expand "bgtu"
[(set (pc) [(set (pc)
...@@ -688,7 +716,15 @@ ...@@ -688,7 +716,15 @@
(pc)))] (pc)))]
"" ""
" "
{ operands[1] = gen_compare_reg (LT, sparc_compare_op0, sparc_compare_op1); }") {
if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD)
{
emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, LT);
emit_insn (gen_bne (operands[0]));
DONE;
}
operands[1] = gen_compare_reg (LT, sparc_compare_op0, sparc_compare_op1);
}")
(define_expand "bltu" (define_expand "bltu"
[(set (pc) [(set (pc)
...@@ -707,7 +743,15 @@ ...@@ -707,7 +743,15 @@
(pc)))] (pc)))]
"" ""
" "
{ operands[1] = gen_compare_reg (GE, sparc_compare_op0, sparc_compare_op1); }") {
if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD)
{
emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, GE);
emit_insn (gen_bne (operands[0]));
DONE;
}
operands[1] = gen_compare_reg (GE, sparc_compare_op0, sparc_compare_op1);
}")
(define_expand "bgeu" (define_expand "bgeu"
[(set (pc) [(set (pc)
...@@ -726,7 +770,15 @@ ...@@ -726,7 +770,15 @@
(pc)))] (pc)))]
"" ""
" "
{ operands[1] = gen_compare_reg (LE, sparc_compare_op0, sparc_compare_op1); }") {
if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD)
{
emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, LE);
emit_insn (gen_bne (operands[0]));
DONE;
}
operands[1] = gen_compare_reg (LE, sparc_compare_op0, sparc_compare_op1);
}")
(define_expand "bleu" (define_expand "bleu"
[(set (pc) [(set (pc)
...@@ -1585,7 +1637,7 @@ ...@@ -1585,7 +1637,7 @@
[(set (match_operand:TF 0 "register_operand" "=f") [(set (match_operand:TF 0 "register_operand" "=f")
(float_extend:TF (float_extend:TF
(match_operand:SF 1 "register_operand" "f")))] (match_operand:SF 1 "register_operand" "f")))]
"TARGET_FPU" "TARGET_FPU && TARGET_HARD_QUAD"
"fstoq %1,%0" "fstoq %1,%0"
[(set_attr "type" "fp")]) [(set_attr "type" "fp")])
...@@ -1593,7 +1645,7 @@ ...@@ -1593,7 +1645,7 @@
[(set (match_operand:TF 0 "register_operand" "=f") [(set (match_operand:TF 0 "register_operand" "=f")
(float_extend:TF (float_extend:TF
(match_operand:DF 1 "register_operand" "f")))] (match_operand:DF 1 "register_operand" "f")))]
"TARGET_FPU" "TARGET_FPU && TARGET_HARD_QUAD"
"fdtoq %1,%0" "fdtoq %1,%0"
[(set_attr "type" "fp")]) [(set_attr "type" "fp")])
...@@ -1609,7 +1661,7 @@ ...@@ -1609,7 +1661,7 @@
[(set (match_operand:SF 0 "register_operand" "=f") [(set (match_operand:SF 0 "register_operand" "=f")
(float_truncate:SF (float_truncate:SF
(match_operand:TF 1 "register_operand" "f")))] (match_operand:TF 1 "register_operand" "f")))]
"TARGET_FPU" "TARGET_FPU && TARGET_HARD_QUAD"
"fqtos %1,%0" "fqtos %1,%0"
[(set_attr "type" "fp")]) [(set_attr "type" "fp")])
...@@ -1617,7 +1669,7 @@ ...@@ -1617,7 +1669,7 @@
[(set (match_operand:DF 0 "register_operand" "=f") [(set (match_operand:DF 0 "register_operand" "=f")
(float_truncate:DF (float_truncate:DF
(match_operand:TF 1 "register_operand" "f")))] (match_operand:TF 1 "register_operand" "f")))]
"TARGET_FPU" "TARGET_FPU && TARGET_HARD_QUAD"
"fqtod %1,%0" "fqtod %1,%0"
[(set_attr "type" "fp")]) [(set_attr "type" "fp")])
...@@ -1640,7 +1692,7 @@ ...@@ -1640,7 +1692,7 @@
(define_insn "floatsitf2" (define_insn "floatsitf2"
[(set (match_operand:TF 0 "register_operand" "=f") [(set (match_operand:TF 0 "register_operand" "=f")
(float:TF (match_operand:SI 1 "register_operand" "f")))] (float:TF (match_operand:SI 1 "register_operand" "f")))]
"TARGET_FPU" "TARGET_FPU && TARGET_HARD_QUAD"
"fitoq %1,%0" "fitoq %1,%0"
[(set_attr "type" "fp")]) [(set_attr "type" "fp")])
...@@ -1664,7 +1716,7 @@ ...@@ -1664,7 +1716,7 @@
(define_insn "fix_trunctfsi2" (define_insn "fix_trunctfsi2"
[(set (match_operand:SI 0 "register_operand" "=f") [(set (match_operand:SI 0 "register_operand" "=f")
(fix:SI (fix:TF (match_operand:TF 1 "register_operand" "f"))))] (fix:SI (fix:TF (match_operand:TF 1 "register_operand" "f"))))]
"TARGET_FPU" "TARGET_FPU && TARGET_HARD_QUAD"
"fqtoi %1,%0" "fqtoi %1,%0"
[(set_attr "type" "fp")]) [(set_attr "type" "fp")])
...@@ -2409,7 +2461,7 @@ ...@@ -2409,7 +2461,7 @@
[(set (match_operand:TF 0 "register_operand" "=f") [(set (match_operand:TF 0 "register_operand" "=f")
(plus:TF (match_operand:TF 1 "register_operand" "f") (plus:TF (match_operand:TF 1 "register_operand" "f")
(match_operand:TF 2 "register_operand" "f")))] (match_operand:TF 2 "register_operand" "f")))]
"TARGET_FPU" "TARGET_FPU && TARGET_HARD_QUAD"
"faddq %1,%2,%0" "faddq %1,%2,%0"
[(set_attr "type" "fp")]) [(set_attr "type" "fp")])
...@@ -2433,7 +2485,7 @@ ...@@ -2433,7 +2485,7 @@
[(set (match_operand:TF 0 "register_operand" "=f") [(set (match_operand:TF 0 "register_operand" "=f")
(minus:TF (match_operand:TF 1 "register_operand" "f") (minus:TF (match_operand:TF 1 "register_operand" "f")
(match_operand:TF 2 "register_operand" "f")))] (match_operand:TF 2 "register_operand" "f")))]
"TARGET_FPU" "TARGET_FPU && TARGET_HARD_QUAD"
"fsubq %1,%2,%0" "fsubq %1,%2,%0"
[(set_attr "type" "fp")]) [(set_attr "type" "fp")])
...@@ -2457,7 +2509,7 @@ ...@@ -2457,7 +2509,7 @@
[(set (match_operand:TF 0 "register_operand" "=f") [(set (match_operand:TF 0 "register_operand" "=f")
(mult:TF (match_operand:TF 1 "register_operand" "f") (mult:TF (match_operand:TF 1 "register_operand" "f")
(match_operand:TF 2 "register_operand" "f")))] (match_operand:TF 2 "register_operand" "f")))]
"TARGET_FPU" "TARGET_FPU && TARGET_HARD_QUAD"
"fmulq %1,%2,%0" "fmulq %1,%2,%0"
[(set_attr "type" "fpmul")]) [(set_attr "type" "fpmul")])
...@@ -2497,7 +2549,7 @@ ...@@ -2497,7 +2549,7 @@
[(set (match_operand:TF 0 "register_operand" "=f") [(set (match_operand:TF 0 "register_operand" "=f")
(div:TF (match_operand:TF 1 "register_operand" "f") (div:TF (match_operand:TF 1 "register_operand" "f")
(match_operand:TF 2 "register_operand" "f")))] (match_operand:TF 2 "register_operand" "f")))]
"TARGET_FPU" "TARGET_FPU && TARGET_HARD_QUAD"
"fdivq %1,%2,%0" "fdivq %1,%2,%0"
[(set_attr "type" "fpdiv")]) [(set_attr "type" "fpdiv")])
...@@ -2574,7 +2626,7 @@ ...@@ -2574,7 +2626,7 @@
(define_insn "sqrttf2" (define_insn "sqrttf2"
[(set (match_operand:TF 0 "register_operand" "=f") [(set (match_operand:TF 0 "register_operand" "=f")
(sqrt:TF (match_operand:TF 1 "register_operand" "f")))] (sqrt:TF (match_operand:TF 1 "register_operand" "f")))]
"TARGET_FPU" "TARGET_FPU && TARGET_HARD_QUAD"
"fsqrtq %1,%0" "fsqrtq %1,%0"
[(set_attr "type" "fpsqrt")]) [(set_attr "type" "fpsqrt")])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment