This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[patch] MIPS64: Use non-trapping "daddu" in macro expansions
- From: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
- To: binutils at sources dot redhat dot com
- Date: Thu, 4 Jul 2002 15:40:13 +0200 (MET DST)
- Subject: [patch] MIPS64: Use non-trapping "daddu" in macro expansions
- Organization: Technical University of Gdansk
Hello,
I believe it's incorrect to use "dadd" to calculate addresses as we don't
handle overflow traps in any manner. That is strictly system-dependent
and should be handled at the compiler level, anyway. I propose switching
to "daddu".
2002-07-04 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
* config/tc-mips.c (load_address): Use non-trapping "daddu"
instead of "dadd" in address calculations.
(macro): Likewise.
Maciej
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
binutils-2.12.90-20020702-mips64-dadd.patch
diff -up --recursive --new-file binutils-2.12.90-20020702.macro/gas/config/tc-mips.c binutils-2.12.90-20020702/gas/config/tc-mips.c
--- binutils-2.12.90-20020702.macro/gas/config/tc-mips.c 2002-06-15 03:25:24.000000000 +0000
+++ binutils-2.12.90-20020702/gas/config/tc-mips.c 2002-07-02 20:16:36.000000000 +0000
@@ -3528,7 +3528,7 @@ load_address (counter, reg, ep, used_at)
daddiu $reg,<sym> (BFD_RELOC_MIPS_HIGHER)
daddiu $at,<sym> (BFD_RELOC_LO16)
dsll32 $reg,0
- dadd $reg,$reg,$at
+ daddu $reg,$reg,$at
If $at is already in use, we use an path which is suboptimal
on superscalar processors.
@@ -3556,7 +3556,7 @@ load_address (counter, reg, ep, used_at)
AT, AT, (int) BFD_RELOC_LO16);
macro_build (p, counter, (expressionS *) NULL, "dsll32",
"d,w,<", reg, reg, 0);
- macro_build (p, counter, (expressionS *) NULL, "dadd",
+ macro_build (p, counter, (expressionS *) NULL, "daddu",
"d,v,t", reg, reg, AT);
*used_at = 1;
}
@@ -4542,7 +4542,7 @@ macro (ip)
daddiu $tempreg,<sym> (BFD_RELOC_MIPS_HIGHER)
daddiu $at,<sym> (BFD_RELOC_LO16)
dsll32 $tempreg,0
- dadd $tempreg,$tempreg,$at
+ daddu $tempreg,$tempreg,$at
If $at is already in use, we use an path which is suboptimal
on superscalar processors.
@@ -4571,7 +4571,7 @@ macro (ip)
AT, AT, (int) BFD_RELOC_LO16);
macro_build (p, &icnt, (expressionS *) NULL, "dsll32",
"d,w,<", tempreg, tempreg, 0);
- macro_build (p, &icnt, (expressionS *) NULL, "dadd", "d,v,t",
+ macro_build (p, &icnt, (expressionS *) NULL, "daddu", "d,v,t",
tempreg, tempreg, AT);
used_at = 1;
}