Skip to content

Commit 6110050

Browse files
AMarkovicralfbaechle
authored andcommitted
MIPS: math-emu: Avoid multiple assignment
Replace several instances of multiple assignment with individual assignments. Signed-off-by: Aleksandar Markovic <[email protected]> Cc: Douglas Leung <[email protected]> Cc: Goran Ferenc <[email protected]> Cc: James Hogan <[email protected]> Cc: Maciej W. Rozycki <[email protected]> Cc: Manuel Lauss <[email protected]> Cc: Miodrag Dinic <[email protected]> Cc: Paul Burton <[email protected]> Cc: Petar Jovanovic <[email protected]> Cc: Raghu Gandham <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/17587/ Signed-off-by: Ralf Baechle <[email protected]>
1 parent 8904d5b commit 6110050

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

arch/mips/math-emu/cp1emu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,8 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
11901190
if (!cpu_has_mips_r6 || delay_slot(xcp))
11911191
return SIGILL;
11921192

1193-
cond = likely = 0;
1193+
likely = 0;
1194+
cond = 0;
11941195
fpr = &current->thread.fpu.fpr[MIPSInst_RT(ir)];
11951196
bit0 = get_fpr32(fpr, 0) & 0x1;
11961197
switch (MIPSInst_RS(ir)) {

arch/mips/math-emu/dp_sqrt.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ union ieee754dp ieee754dp_sqrt(union ieee754dp x)
9191
scalx -= 256;
9292
}
9393

94-
y = x = builddp(0, xe + DP_EBIAS, xm & ~DP_HIDDEN_BIT);
94+
x = builddp(0, xe + DP_EBIAS, xm & ~DP_HIDDEN_BIT);
95+
y = x;
9596

9697
/* magic initial approximation to almost 8 sig. bits */
9798
yh = y.bits >> 32;
@@ -108,7 +109,8 @@ union ieee754dp ieee754dp_sqrt(union ieee754dp x)
108109

109110
/* triple to almost 56 sig. bits: y ~= sqrt(x) to within 1 ulp */
110111
/* t=y*y; z=t; pt[n0]+=0x00100000; t+=z; z=(x-z)*y; */
111-
z = t = ieee754dp_mul(y, y);
112+
t = ieee754dp_mul(y, y);
113+
z = t;
112114
t.bexp += 0x001;
113115
t = ieee754dp_add(t, z);
114116
z = ieee754dp_mul(ieee754dp_sub(x, z), y);

arch/mips/math-emu/sp_sqrt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ union ieee754sp ieee754sp_sqrt(union ieee754sp x)
8282

8383
/* generate sqrt(x) bit by bit */
8484
ix += ix;
85-
q = s = 0; /* q = sqrt(x) */
85+
s = 0;
86+
q = 0; /* q = sqrt(x) */
8687
r = 0x01000000; /* r = moving bit from right to left */
8788

8889
while (r != 0) {

0 commit comments

Comments
 (0)