-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve m68k sqrt patch not to suppress insn on archs where it works
the 60840 fpu and later, and coldfire fpus, have precision-specific sqrt instructions that get used and do the right thing. only when targeting baseline (or near-baseline) ISA does the ld80-only instruction get used, and that's all that needs to be suppressed.
- Loading branch information
1 parent
d04fb49
commit 531af98
Showing
5 changed files
with
75 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,18 @@ | ||
--- gcc-9.2.0.orig/gcc/config/m68k/m68k.md 2019-01-01 07:31:55.000000000 -0500 | ||
+++ gcc-9.2.0/gcc/config/m68k/m68k.md 2020-06-30 15:56:20.061868526 -0400 | ||
@@ -4121,35 +4121,6 @@ | ||
return "f<FP:prec>neg%.<FP:prec> %1,%0"; | ||
}) | ||
|
||
-;; Sqrt instruction for the 68881 | ||
- | ||
-(define_expand "sqrt<mode>2" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "")))] | ||
+++ gcc-9.2.0/gcc/config/m68k/m68k.md 2020-07-01 15:57:20.528408009 -0400 | ||
@@ -4126,13 +4126,13 @@ | ||
(define_expand "sqrt<mode>2" | ||
[(set (match_operand:FP 0 "nonimmediate_operand" "") | ||
(sqrt:FP (match_operand:FP 1 "general_operand" "")))] | ||
- "TARGET_HARD_FLOAT" | ||
- "") | ||
- | ||
-(define_insn "sqrt<mode>2_68881" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))] | ||
- "TARGET_68881" | ||
-{ | ||
- if (FP_REG_P (operands[1])) | ||
- return "f<FP:round>sqrt%.x %1,%0"; | ||
- return "f<FP:round>sqrt%.<FP:prec> %1,%0"; | ||
-} | ||
- [(set_attr "type" "fsqrt")]) | ||
- | ||
-(define_insn "sqrt<mode>2_cf" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U")))] | ||
- "TARGET_COLDFIRE_FPU" | ||
-{ | ||
- if (FP_REG_P (operands[1])) | ||
- return "f<FP:prec>sqrt%.d %1,%0"; | ||
- return "f<FP:prec>sqrt%.<FP:prec> %1,%0"; | ||
-} | ||
- [(set_attr "type" "fsqrt")]) | ||
;; Absolute value instructions | ||
;; If using software floating point, just zero the sign bit. | ||
+ "(TARGET_68881 && TARGET_68040) || TARGET_COLDFIRE_FPU" | ||
"") | ||
|
||
(define_insn "sqrt<mode>2_68881" | ||
[(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
(sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))] | ||
- "TARGET_68881" | ||
+ "TARGET_68881 && TARGET_68040" | ||
{ | ||
if (FP_REG_P (operands[1])) | ||
return "f<FP:round>sqrt%.x %1,%0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,18 @@ | ||
--- gcc-9.2.0.orig/gcc/config/m68k/m68k.md 2019-01-01 07:31:55.000000000 -0500 | ||
+++ gcc-9.2.0/gcc/config/m68k/m68k.md 2020-06-30 15:56:20.061868526 -0400 | ||
@@ -4121,35 +4121,6 @@ | ||
return "f<FP:prec>neg%.<FP:prec> %1,%0"; | ||
}) | ||
|
||
-;; Sqrt instruction for the 68881 | ||
- | ||
-(define_expand "sqrt<mode>2" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "")))] | ||
+++ gcc-9.2.0/gcc/config/m68k/m68k.md 2020-07-01 15:57:20.528408009 -0400 | ||
@@ -4126,13 +4126,13 @@ | ||
(define_expand "sqrt<mode>2" | ||
[(set (match_operand:FP 0 "nonimmediate_operand" "") | ||
(sqrt:FP (match_operand:FP 1 "general_operand" "")))] | ||
- "TARGET_HARD_FLOAT" | ||
- "") | ||
- | ||
-(define_insn "sqrt<mode>2_68881" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))] | ||
- "TARGET_68881" | ||
-{ | ||
- if (FP_REG_P (operands[1])) | ||
- return "f<FP:round>sqrt%.x %1,%0"; | ||
- return "f<FP:round>sqrt%.<FP:prec> %1,%0"; | ||
-} | ||
- [(set_attr "type" "fsqrt")]) | ||
- | ||
-(define_insn "sqrt<mode>2_cf" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U")))] | ||
- "TARGET_COLDFIRE_FPU" | ||
-{ | ||
- if (FP_REG_P (operands[1])) | ||
- return "f<FP:prec>sqrt%.d %1,%0"; | ||
- return "f<FP:prec>sqrt%.<FP:prec> %1,%0"; | ||
-} | ||
- [(set_attr "type" "fsqrt")]) | ||
;; Absolute value instructions | ||
;; If using software floating point, just zero the sign bit. | ||
+ "(TARGET_68881 && TARGET_68040) || TARGET_COLDFIRE_FPU" | ||
"") | ||
|
||
(define_insn "sqrt<mode>2_68881" | ||
[(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
(sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))] | ||
- "TARGET_68881" | ||
+ "TARGET_68881 && TARGET_68040" | ||
{ | ||
if (FP_REG_P (operands[1])) | ||
return "f<FP:round>sqrt%.x %1,%0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,18 @@ | ||
--- gcc-9.2.0.orig/gcc/config/m68k/m68k.md 2019-01-01 07:31:55.000000000 -0500 | ||
+++ gcc-9.2.0/gcc/config/m68k/m68k.md 2020-06-30 15:56:20.061868526 -0400 | ||
@@ -4121,35 +4121,6 @@ | ||
return "f<FP:prec>neg%.<FP:prec> %1,%0"; | ||
}) | ||
|
||
-;; Sqrt instruction for the 68881 | ||
- | ||
-(define_expand "sqrt<mode>2" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "")))] | ||
+++ gcc-9.2.0/gcc/config/m68k/m68k.md 2020-07-01 15:57:20.528408009 -0400 | ||
@@ -4126,13 +4126,13 @@ | ||
(define_expand "sqrt<mode>2" | ||
[(set (match_operand:FP 0 "nonimmediate_operand" "") | ||
(sqrt:FP (match_operand:FP 1 "general_operand" "")))] | ||
- "TARGET_HARD_FLOAT" | ||
- "") | ||
- | ||
-(define_insn "sqrt<mode>2_68881" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))] | ||
- "TARGET_68881" | ||
-{ | ||
- if (FP_REG_P (operands[1])) | ||
- return "f<FP:round>sqrt%.x %1,%0"; | ||
- return "f<FP:round>sqrt%.<FP:prec> %1,%0"; | ||
-} | ||
- [(set_attr "type" "fsqrt")]) | ||
- | ||
-(define_insn "sqrt<mode>2_cf" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U")))] | ||
- "TARGET_COLDFIRE_FPU" | ||
-{ | ||
- if (FP_REG_P (operands[1])) | ||
- return "f<FP:prec>sqrt%.d %1,%0"; | ||
- return "f<FP:prec>sqrt%.<FP:prec> %1,%0"; | ||
-} | ||
- [(set_attr "type" "fsqrt")]) | ||
;; Absolute value instructions | ||
;; If using software floating point, just zero the sign bit. | ||
+ "(TARGET_68881 && TARGET_68040) || TARGET_COLDFIRE_FPU" | ||
"") | ||
|
||
(define_insn "sqrt<mode>2_68881" | ||
[(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
(sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))] | ||
- "TARGET_68881" | ||
+ "TARGET_68881 && TARGET_68040" | ||
{ | ||
if (FP_REG_P (operands[1])) | ||
return "f<FP:round>sqrt%.x %1,%0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,18 @@ | ||
--- gcc-9.2.0.orig/gcc/config/m68k/m68k.md 2019-01-01 07:31:55.000000000 -0500 | ||
+++ gcc-9.2.0/gcc/config/m68k/m68k.md 2020-06-30 15:56:20.061868526 -0400 | ||
@@ -4121,35 +4121,6 @@ | ||
return "f<FP:prec>neg%.<FP:prec> %1,%0"; | ||
}) | ||
|
||
-;; Sqrt instruction for the 68881 | ||
- | ||
-(define_expand "sqrt<mode>2" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "")))] | ||
+++ gcc-9.2.0/gcc/config/m68k/m68k.md 2020-07-01 15:57:20.528408009 -0400 | ||
@@ -4126,13 +4126,13 @@ | ||
(define_expand "sqrt<mode>2" | ||
[(set (match_operand:FP 0 "nonimmediate_operand" "") | ||
(sqrt:FP (match_operand:FP 1 "general_operand" "")))] | ||
- "TARGET_HARD_FLOAT" | ||
- "") | ||
- | ||
-(define_insn "sqrt<mode>2_68881" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))] | ||
- "TARGET_68881" | ||
-{ | ||
- if (FP_REG_P (operands[1])) | ||
- return "f<FP:round>sqrt%.x %1,%0"; | ||
- return "f<FP:round>sqrt%.<FP:prec> %1,%0"; | ||
-} | ||
- [(set_attr "type" "fsqrt")]) | ||
- | ||
-(define_insn "sqrt<mode>2_cf" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U")))] | ||
- "TARGET_COLDFIRE_FPU" | ||
-{ | ||
- if (FP_REG_P (operands[1])) | ||
- return "f<FP:prec>sqrt%.d %1,%0"; | ||
- return "f<FP:prec>sqrt%.<FP:prec> %1,%0"; | ||
-} | ||
- [(set_attr "type" "fsqrt")]) | ||
;; Absolute value instructions | ||
;; If using software floating point, just zero the sign bit. | ||
+ "(TARGET_68881 && TARGET_68040) || TARGET_COLDFIRE_FPU" | ||
"") | ||
|
||
(define_insn "sqrt<mode>2_68881" | ||
[(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
(sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))] | ||
- "TARGET_68881" | ||
+ "TARGET_68881 && TARGET_68040" | ||
{ | ||
if (FP_REG_P (operands[1])) | ||
return "f<FP:round>sqrt%.x %1,%0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,18 @@ | ||
--- gcc-9.2.0.orig/gcc/config/m68k/m68k.md 2019-01-01 07:31:55.000000000 -0500 | ||
+++ gcc-9.2.0/gcc/config/m68k/m68k.md 2020-06-30 15:56:20.061868526 -0400 | ||
@@ -4121,35 +4121,6 @@ | ||
return "f<FP:prec>neg%.<FP:prec> %1,%0"; | ||
}) | ||
|
||
-;; Sqrt instruction for the 68881 | ||
- | ||
-(define_expand "sqrt<mode>2" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "")))] | ||
+++ gcc-9.2.0/gcc/config/m68k/m68k.md 2020-07-01 15:57:20.528408009 -0400 | ||
@@ -4126,13 +4126,13 @@ | ||
(define_expand "sqrt<mode>2" | ||
[(set (match_operand:FP 0 "nonimmediate_operand" "") | ||
(sqrt:FP (match_operand:FP 1 "general_operand" "")))] | ||
- "TARGET_HARD_FLOAT" | ||
- "") | ||
- | ||
-(define_insn "sqrt<mode>2_68881" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))] | ||
- "TARGET_68881" | ||
-{ | ||
- if (FP_REG_P (operands[1])) | ||
- return "f<FP:round>sqrt%.x %1,%0"; | ||
- return "f<FP:round>sqrt%.<FP:prec> %1,%0"; | ||
-} | ||
- [(set_attr "type" "fsqrt")]) | ||
- | ||
-(define_insn "sqrt<mode>2_cf" | ||
- [(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
- (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U")))] | ||
- "TARGET_COLDFIRE_FPU" | ||
-{ | ||
- if (FP_REG_P (operands[1])) | ||
- return "f<FP:prec>sqrt%.d %1,%0"; | ||
- return "f<FP:prec>sqrt%.<FP:prec> %1,%0"; | ||
-} | ||
- [(set_attr "type" "fsqrt")]) | ||
;; Absolute value instructions | ||
;; If using software floating point, just zero the sign bit. | ||
+ "(TARGET_68881 && TARGET_68040) || TARGET_COLDFIRE_FPU" | ||
"") | ||
|
||
(define_insn "sqrt<mode>2_68881" | ||
[(set (match_operand:FP 0 "nonimmediate_operand" "=f") | ||
(sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))] | ||
- "TARGET_68881" | ||
+ "TARGET_68881 && TARGET_68040" | ||
{ | ||
if (FP_REG_P (operands[1])) | ||
return "f<FP:round>sqrt%.x %1,%0"; |