Commit 5f7d2c16 authored by Ralph Siemsen's avatar Ralph Siemsen Committed by Russell King

[NWFPE] performance improvements [Part 2]

Second part of NWFPE improvements.  Builds on top of patch 1464/1.

Remove unused code.  And fix a function prototype to match function.
No impact on generated code or NWFPE performance.
parent 95a3352a
2003-03-22 Ralph Siemsen <ralphs@netwinder.org>
* Reformat all but softfloat files to get a consistent coding style.
Used "indent -kr -i8 -ts8 -sob -l132 -ss" and a few manual fixups.
* Removed dead code and fixed function protypes to match definitions.
2002-01-19 Russell King <rmk@arm.linux.org.uk>
......
......@@ -47,77 +47,43 @@ static void resetFPA11(void)
/* FPSR: set system id to FP_EMULATOR, set AC, clear all other bits */
fpa11->fpsr = FP_EMULATOR | BIT_AC;
/* FPCR: set SB, AB and DA bits, clear all others */
#if MAINTAIN_FPCR
fpa11->fpcr = MASK_RESET;
#endif
}
void SetRoundingMode(const unsigned int opcode)
{
#if MAINTAIN_FPCR
FPA11 *fpa11 = GET_FPA11();
fpa11->fpcr &= ~MASK_ROUNDING_MODE;
#endif
switch (opcode & MASK_ROUNDING_MODE) {
default:
case ROUND_TO_NEAREST:
float_rounding_mode = float_round_nearest_even;
#if MAINTAIN_FPCR
fpa11->fpcr |= ROUND_TO_NEAREST;
#endif
break;
case ROUND_TO_PLUS_INFINITY:
float_rounding_mode = float_round_up;
#if MAINTAIN_FPCR
fpa11->fpcr |= ROUND_TO_PLUS_INFINITY;
#endif
break;
case ROUND_TO_MINUS_INFINITY:
float_rounding_mode = float_round_down;
#if MAINTAIN_FPCR
fpa11->fpcr |= ROUND_TO_MINUS_INFINITY;
#endif
break;
case ROUND_TO_ZERO:
float_rounding_mode = float_round_to_zero;
#if MAINTAIN_FPCR
fpa11->fpcr |= ROUND_TO_ZERO;
#endif
break;
}
}
void SetRoundingPrecision(const unsigned int opcode)
{
#if MAINTAIN_FPCR
FPA11 *fpa11 = GET_FPA11();
fpa11->fpcr &= ~MASK_ROUNDING_PRECISION;
#endif
switch (opcode & MASK_ROUNDING_PRECISION) {
case ROUND_SINGLE:
floatx80_rounding_precision = 32;
#if MAINTAIN_FPCR
fpa11->fpcr |= ROUND_SINGLE;
#endif
break;
case ROUND_DOUBLE:
floatx80_rounding_precision = 64;
#if MAINTAIN_FPCR
fpa11->fpcr |= ROUND_DOUBLE;
#endif
break;
case ROUND_EXTENDED:
floatx80_rounding_precision = 80;
#if MAINTAIN_FPCR
fpa11->fpcr |= ROUND_EXTENDED;
#endif
break;
default:
......@@ -167,47 +133,3 @@ unsigned int EmulateAll(unsigned int opcode)
return (nRc);
}
#if 0
unsigned int EmulateAll1(unsigned int opcode)
{
switch ((opcode >> 24) & 0xf) {
case 0xc:
case 0xd:
if ((opcode >> 20) & 0x1) {
switch ((opcode >> 8) & 0xf) {
case 0x1:
return PerformLDF(opcode);
break;
case 0x2:
return PerformLFM(opcode);
break;
default:
return 0;
}
} else {
switch ((opcode >> 8) & 0xf) {
case 0x1:
return PerformSTF(opcode);
break;
case 0x2:
return PerformSFM(opcode);
break;
default:
return 0;
}
}
break;
case 0xe:
if (opcode & 0x10)
return EmulateCPDO(opcode);
else
return EmulateCPRT(opcode);
break;
default:
return 0;
}
}
#endif
......@@ -22,9 +22,9 @@
#include "fpa11.h"
#include "fpopcode.h"
unsigned int SingleCPDO(const unsigned int opcode, FPREG * rfd);
unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rfd);
unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rfd);
unsigned int SingleCPDO(const unsigned int opcode, FPREG * rFd);
unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd);
unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd);
unsigned int EmulateCPDO(const unsigned int opcode)
{
......@@ -32,8 +32,6 @@ unsigned int EmulateCPDO(const unsigned int opcode)
FPREG *rFd;
unsigned int nType, nDest, nRc;
//printk("EmulateCPDO(0x%08x)\n",opcode);
/* Get the destination size. If not valid let Linux perform
an invalid instruction trap. */
nDest = getDestinationSize(opcode);
......
......@@ -194,8 +194,6 @@ unsigned int PerformLDF(const unsigned int opcode)
unsigned int *pBase, *pAddress, *pFinal, nRc = 1,
write_back = WRITE_BACK(opcode);
//printk("PerformLDF(0x%08x), Fd = 0x%08x\n",opcode,getFd(opcode));
pBase = (unsigned int *) readRegister(getRn(opcode));
if (REG_PC == getRn(opcode)) {
pBase += 2;
......@@ -237,7 +235,6 @@ unsigned int PerformSTF(const unsigned int opcode)
unsigned int *pBase, *pAddress, *pFinal, nRc = 1,
write_back = WRITE_BACK(opcode);
//printk("PerformSTF(0x%08x), Fd = 0x%08x\n",opcode,getFd(opcode));
SetRoundingMode(ROUND_TO_NEAREST);
pBase = (unsigned int *) readRegister(getRn(opcode));
......@@ -348,13 +345,10 @@ unsigned int PerformSFM(const unsigned int opcode)
return 1;
}
#if 1
unsigned int EmulateCPDT(const unsigned int opcode)
{
unsigned int nRc = 0;
//printk("EmulateCPDT(0x%08x)\n",opcode);
if (LDF_OP(opcode)) {
nRc = PerformLDF(opcode);
} else if (LFM_OP(opcode)) {
......@@ -369,4 +363,3 @@ unsigned int EmulateCPDT(const unsigned int opcode)
return nRc;
}
#endif
......@@ -43,8 +43,6 @@ unsigned int EmulateCPRT(const unsigned int opcode)
{
unsigned int nRc = 1;
//printk("EmulateCPRT(0x%08x)\n",opcode);
if (opcode & 0x800000) {
/* This is some variant of a comparison (PerformComparison will
sort out which one). Since most of the other CPRT
......@@ -179,7 +177,6 @@ static unsigned int __inline__ PerformComparisonOperation(floatx80 Fn, floatx80
}
/* This instruction sets the flags N, Z, C, V in the FPSR. */
static unsigned int PerformComparison(const unsigned int opcode)
{
FPA11 *fpa11 = GET_FPA11();
......@@ -189,8 +186,6 @@ static unsigned int PerformComparison(const unsigned int opcode)
int n_flag = opcode & 0x200000; /* 1 if CNxx */
unsigned int flags = 0;
//printk("PerformComparison(0x%08x)\n",opcode);
Fn = getFn(opcode);
Fm = getFm(opcode);
......
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