Beispiel #1
0
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));
   if (REG_PC == getRn(opcode))
   {
     pBase += 2;
     write_back = 0;
   }

   pFinal = pBase;
   if (BIT_UP_SET(opcode))
     pFinal += getOffset(opcode);
   else
     pFinal -= getOffset(opcode);

   if (PREINDEXED(opcode)) pAddress = pFinal; else pAddress = pBase;

   switch (opcode & MASK_TRANSFER_LENGTH)
   {
      case TRANSFER_SINGLE  : storeSingle(getFd(opcode),pAddress);   break;
      case TRANSFER_DOUBLE  : storeDouble(getFd(opcode),pAddress);   break;
      case TRANSFER_EXTENDED: storeExtended(getFd(opcode),pAddress); break;
      default: nRc = 0;
   }
   
   if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal);
   return nRc;
}
Beispiel #2
0
unsigned int PerformSTF(const unsigned int opcode)
{
	unsigned int __user *pBase, *pAddress, *pFinal;
	unsigned int nRc = 1, write_back = WRITE_BACK(opcode);
	struct roundingData roundData;

	roundData.mode = SetRoundingMode(opcode);
	roundData.precision = SetRoundingPrecision(opcode);
	roundData.exception = 0;

	pBase = (unsigned int __user *) readRegister(getRn(opcode));
	if (REG_PC == getRn(opcode)) {
		pBase += 2;
		write_back = 0;
	}

	pFinal = pBase;
	if (BIT_UP_SET(opcode))
		pFinal += getOffset(opcode);
	else
		pFinal -= getOffset(opcode);

	if (PREINDEXED(opcode))
		pAddress = pFinal;
	else
		pAddress = pBase;

	switch (opcode & MASK_TRANSFER_LENGTH) {
	case TRANSFER_SINGLE:
		storeSingle(&roundData, getFd(opcode), pAddress);
		break;
	case TRANSFER_DOUBLE:
		storeDouble(&roundData, getFd(opcode), pAddress);
		break;
#ifdef CONFIG_FPE_NWFPE_XP
	case TRANSFER_EXTENDED:
		storeExtended(getFd(opcode), pAddress);
		break;
#endif
	default:
		nRc = 0;
	}

	if (roundData.exception)
		float_raise(roundData.exception);

	if (write_back)
		writeRegister(getRn(opcode), (unsigned long) pFinal);
	return nRc;
}