Commit 44ba138f authored by Maciej W. Rozycki's avatar Maciej W. Rozycki Committed by Ralf Baechle

MIPS: csum_partial.S CPU_DADDI_WORKAROUNDS bug fix

This change reverts most of commit
60724ca5 [MIPS: IP checksums: Remove
unncessary .set pseudos] that introduced warnings with the
CPU_DADDI_WORKAROUNDS option set:

arch/mips/lib/csum_partial.S: Assembler messages:
arch/mips/lib/csum_partial.S:467: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:467: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:467: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:467: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:467: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:467: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:467: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:467: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:467: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:467: Warning: used $3 with ".set at=$3"
[...]
arch/mips/lib/csum_partial.S:577: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:577: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:577: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:601: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:601: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:601: Warning: used $3 with ".set at=$3"
arch/mips/lib/csum_partial.S:601: Warning: used $3 with ".set at=$3"
[and so on, and so on...]

The warnings are benign and good code is produced regardless because no
macros that'd use the assembler's temporary register are involved, however
the `.set noat' directives removed by the commit referred are crucial to
guarantee this is still going to be the case after any changes in the
future.  Therefore they need to be brought back to place which this
change does.
Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/6686/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 465ca5d6
...@@ -56,14 +56,20 @@ ...@@ -56,14 +56,20 @@
#define UNIT(unit) ((unit)*NBYTES) #define UNIT(unit) ((unit)*NBYTES)
#define ADDC(sum,reg) \ #define ADDC(sum,reg) \
.set push; \
.set noat; \
ADD sum, reg; \ ADD sum, reg; \
sltu v1, sum, reg; \ sltu v1, sum, reg; \
ADD sum, v1; \ ADD sum, v1; \
.set pop
#define ADDC32(sum,reg) \ #define ADDC32(sum,reg) \
.set push; \
.set noat; \
addu sum, reg; \ addu sum, reg; \
sltu v1, sum, reg; \ sltu v1, sum, reg; \
addu sum, v1; \ addu sum, v1; \
.set pop
#define CSUM_BIGCHUNK1(src, offset, sum, _t0, _t1, _t2, _t3) \ #define CSUM_BIGCHUNK1(src, offset, sum, _t0, _t1, _t2, _t3) \
LOAD _t0, (offset + UNIT(0))(src); \ LOAD _t0, (offset + UNIT(0))(src); \
...@@ -710,6 +716,8 @@ LEAF(csum_partial) ...@@ -710,6 +716,8 @@ LEAF(csum_partial)
ADDC(sum, t2) ADDC(sum, t2)
.Ldone\@: .Ldone\@:
/* fold checksum */ /* fold checksum */
.set push
.set noat
#ifdef USE_DOUBLE #ifdef USE_DOUBLE
dsll32 v1, sum, 0 dsll32 v1, sum, 0
daddu sum, v1 daddu sum, v1
...@@ -732,6 +740,7 @@ LEAF(csum_partial) ...@@ -732,6 +740,7 @@ LEAF(csum_partial)
or sum, sum, t0 or sum, sum, t0
1: 1:
#endif #endif
.set pop
.set reorder .set reorder
ADDC32(sum, psum) ADDC32(sum, psum)
jr ra jr ra
......
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