Commit 92c6da54 authored by Russell King's avatar Russell King

[ARM] NWFPE 5: Eliminate use of Fd

Slightly better performance can be obtained by eliminating Fd and
calculating it after the math operation.
parent cb56b360
...@@ -30,7 +30,7 @@ unsigned int EmulateCPDO(const unsigned int opcode) ...@@ -30,7 +30,7 @@ unsigned int EmulateCPDO(const unsigned int opcode)
{ {
FPA11 *fpa11 = GET_FPA11(); FPA11 *fpa11 = GET_FPA11();
FPREG *rFd; FPREG *rFd;
unsigned int Fd, nType, nDest, nRc = 1; unsigned int nType, nDest, nRc;
//printk("EmulateCPDO(0x%08x)\n",opcode); //printk("EmulateCPDO(0x%08x)\n",opcode);
...@@ -60,8 +60,7 @@ unsigned int EmulateCPDO(const unsigned int opcode) ...@@ -60,8 +60,7 @@ unsigned int EmulateCPDO(const unsigned int opcode)
} }
} }
Fd = getFd(opcode); rFd = &fpa11->fpreg[getFd(opcode)];
rFd = &fpa11->fpreg[Fd];
switch (nType) switch (nType)
{ {
...@@ -74,47 +73,47 @@ unsigned int EmulateCPDO(const unsigned int opcode) ...@@ -74,47 +73,47 @@ unsigned int EmulateCPDO(const unsigned int opcode)
/* The CPDO functions used to always set the destination type /* The CPDO functions used to always set the destination type
to be the same as their working size. */ to be the same as their working size. */
if ((0 != nRc) && (nDest != nType)) if (nRc != 0)
{ {
/* If the operation succeeded, check to see if the result in the /* If the operation succeeded, check to see if the result in the
destination register is the correct size. If not force it destination register is the correct size. If not force it
to be. */ to be. */
switch (nDest) fpa11->fType[getFd(opcode)] = nDest;
{
case typeSingle:
{
if (typeDouble == nType)
rFd->fSingle = float64_to_float32(rFd->fDouble);
else
rFd->fSingle = floatx80_to_float32(rFd->fExtended);
}
break;
case typeDouble:
{
if (typeSingle == nType)
rFd->fDouble = float32_to_float64(rFd->fSingle);
else
rFd->fDouble = floatx80_to_float64(rFd->fExtended);
}
break;
case typeExtended:
{
if (typeSingle == nType)
rFd->fExtended = float32_to_floatx80(rFd->fSingle);
else
rFd->fExtended = float64_to_floatx80(rFd->fDouble);
}
break;
}
}
if (nRc != 0) if (nDest != nType)
{ {
fpa11->fType[Fd] = nDest; switch (nDest)
{
case typeSingle:
{
if (typeDouble == nType)
rFd->fSingle = float64_to_float32(rFd->fDouble);
else
rFd->fSingle = floatx80_to_float32(rFd->fExtended);
}
break;
case typeDouble:
{
if (typeSingle == nType)
rFd->fDouble = float32_to_float64(rFd->fSingle);
else
rFd->fDouble = floatx80_to_float64(rFd->fExtended);
}
break;
case typeExtended:
{
if (typeSingle == nType)
rFd->fExtended = float32_to_floatx80(rFd->fSingle);
else
rFd->fExtended = float64_to_floatx80(rFd->fDouble);
}
break;
}
}
} }
return nRc; return nRc;
} }
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