os/kernelhwsrv/kerneltest/e32test/math/t_vfp.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/math/t_vfp.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,112 @@
     1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32test\math\t_vfp.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef __T_VFP_H__
    1.22 +#define __T_VFP_H__
    1.23 +#include <e32std.h>
    1.24 +#include <arm_vfp.h>
    1.25 +
    1.26 +#define ARCH_VERSION_VFPV2				1
    1.27 +#define ARCH_VERSION_VFPV3_SUBARCH_V2	2
    1.28 +#define ARCH_VERSION_VFPV3_SUBARCH_NULL	3
    1.29 +#define ARCH_VERSION_VFPV3_SUBARCH_V3	4
    1.30 +
    1.31 +class Vfp
    1.32 +	{
    1.33 +public:
    1.34 +	static TUint32 Fpscr();
    1.35 +	static void SetFpscr(TUint32 aVal);
    1.36 +
    1.37 +	static TReal32 SReg(TInt aReg);
    1.38 +	static void SetSReg(TReal32 aVal, TInt aReg);
    1.39 +	static TInt32 SRegInt(TInt aReg);
    1.40 +	static void SetSReg(TInt32 aVal, TInt aReg);
    1.41 +
    1.42 +	static void AbsS();				// S0 = ABS(S1)
    1.43 +	static void AddS();				// S0 = S1 + S2
    1.44 +	static void CmpS();				// compare S0, S1
    1.45 +	static void CmpES();			// compare S0, S1
    1.46 +	static void CmpEZS();			// compare S0, 0
    1.47 +	static void CmpZS();			// compare S0, 0
    1.48 +	static void Cpy0S(TInt aReg);	// S0 = Sn
    1.49 +	static void CpyS0(TInt aReg);	// Sn = S0
    1.50 +	static void DivS();				// S0 = S1 / S2
    1.51 +	static void MacS();				// S0 += S1 * S2
    1.52 +	static void MscS();				// S0 = S1 * S2 - S0
    1.53 +	static void MulS();				// S0 = S1 * S2
    1.54 +	static void NegS();				// S0 = -S1
    1.55 +	static void NMacS();			// S0 -= S1 * S2
    1.56 +	static void NMscS();			// S0 = -S0 - S1 * S2
    1.57 +	static void NMulS();			// S0 = -S1 * S2
    1.58 +	static void SqrtS();			// S0 = sqrt(S1)
    1.59 +	static void SubS();				// S0 = S1 - S2
    1.60 +
    1.61 +	static TReal64 DReg(TInt aReg);
    1.62 +	static void SetDReg(TReal64 aVal, TInt aReg);
    1.63 +	static TInt64 DRegInt(TInt aReg);
    1.64 +	static void SetDReg(TInt64 aVal, TInt aReg);
    1.65 +	static void AbsD();				// D0 = ABS(D1)
    1.66 +	static void AddD();				// D0 = D1 + D2
    1.67 +	static void CmpD();				// compare D0, D1
    1.68 +	static void CmpED();			// compare D0, D1
    1.69 +	static void CmpEZD();			// compare D0, 0
    1.70 +	static void CmpZD();			// compare D0, 0
    1.71 +	static void Cpy0D(TInt aReg);	// D0 = Dn
    1.72 +	static void CpyD0(TInt aReg);	// Dn = D0
    1.73 +	static void DivD();				// D0 = D1 / D2
    1.74 +	static void MacD();				// D0 += D1 * D2
    1.75 +	static void MscD();				// D0 = D1 * D2 - D0
    1.76 +	static void MulD();				// D0 = D1 * D2
    1.77 +	static void NegD();				// D0 = -D1
    1.78 +	static void NMacD();			// D0 -= D1 * D2
    1.79 +	static void NMscD();			// D0 = -D0 - D1 * D2
    1.80 +	static void NMulD();			// D0 = -D1 * D2
    1.81 +	static void SqrtD();			// D0 = sqrt(D1)
    1.82 +	static void SubD();				// D0 = D1 - D2
    1.83 +
    1.84 +	static void CvtDS();			// D0 = S2
    1.85 +	static void CvtSD();			// S0 = D1
    1.86 +	static void SitoD();			// D0 = IS2
    1.87 +	static void SitoS();			// S0 = IS2
    1.88 +	static void TosiD();			// IS0 = D1
    1.89 +	static void TosiZD();			// IS0 = D1 round towards 0
    1.90 +	static void TosiS();			// IS0 = S2
    1.91 +	static void TosiZS();			// IS0 = S2 round towards 0
    1.92 +	static void UitoD();			// D0 = US2
    1.93 +	static void UitoS();			// S0 = US2
    1.94 +	static void TouiD();			// US0 = D1
    1.95 +	static void TouiZD();			// US0 = D1 round towards 0
    1.96 +	static void TouiS();			// US0 = S2
    1.97 +	static void TouiZS();			// US0 = S2 round towards 0
    1.98 +
    1.99 +	// VFPv3 support
   1.100 +	static void ToFixedS(TInt aBits);	// Convert to fixed (aBits) precision 
   1.101 +	static void FromFixedS(TInt aBits); // Convert from fixed (aBits) precision 
   1.102 +	static void TconstS2();			// S0=2
   1.103 +	static void TconstS2_8();		// S0=2.875
   1.104 +	static void TconstD2();			// D0=2
   1.105 +	static void TconstD2_8();		// D0=2.875
   1.106 +	
   1.107 +	};
   1.108 +
   1.109 +GLREF_C TInt NeonWithF2(TAny*);
   1.110 +GLREF_C TInt NeonWithF3(TAny*);
   1.111 +GLREF_C TInt NeonWithF4x(TAny*);
   1.112 +GLREF_C TInt ThumbMode(TAny*);
   1.113 +
   1.114 +#endif
   1.115 +