aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/nwfpe
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/nwfpe')
-rw-r--r--arch/arm/nwfpe/entry.S8
-rw-r--r--arch/arm/nwfpe/fpopcode.c26
-rw-r--r--arch/arm/nwfpe/fpopcode.h3
3 files changed, 5 insertions, 32 deletions
diff --git a/arch/arm/nwfpe/entry.S b/arch/arm/nwfpe/entry.S
index cafa1835433..d18dde95b8a 100644
--- a/arch/arm/nwfpe/entry.S
+++ b/arch/arm/nwfpe/entry.S
@@ -20,6 +20,8 @@
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/ 21*/
22 22
23#include <asm/opcodes.h>
24
23/* This is the kernel's entry point into the floating point emulator. 25/* This is the kernel's entry point into the floating point emulator.
24It is called from the kernel with code similar to this: 26It is called from the kernel with code similar to this:
25 27
@@ -81,11 +83,11 @@ nwfpe_enter:
81 mov r6, r0 @ save the opcode 83 mov r6, r0 @ save the opcode
82emulate: 84emulate:
83 ldr r1, [sp, #S_PSR] @ fetch the PSR 85 ldr r1, [sp, #S_PSR] @ fetch the PSR
84 bl checkCondition @ check the condition 86 bl arm_check_condition @ check the condition
85 cmp r0, #0 @ r0 = 0 ==> condition failed 87 cmp r0, #ARM_OPCODE_CONDTEST_PASS @ condition passed?
86 88
87 @ if condition code failed to match, next insn 89 @ if condition code failed to match, next insn
88 beq next @ get the next instruction; 90 bne next @ get the next instruction;
89 91
90 mov r0, r6 @ prepare for EmulateAll() 92 mov r0, r6 @ prepare for EmulateAll()
91 bl EmulateAll @ emulate the instruction 93 bl EmulateAll @ emulate the instruction
diff --git a/arch/arm/nwfpe/fpopcode.c b/arch/arm/nwfpe/fpopcode.c
index 922b8110758..ff983467308 100644
--- a/arch/arm/nwfpe/fpopcode.c
+++ b/arch/arm/nwfpe/fpopcode.c
@@ -61,29 +61,3 @@ const float32 float32Constant[] = {
61 0x41200000 /* single 10.0 */ 61 0x41200000 /* single 10.0 */
62}; 62};
63 63
64/* condition code lookup table
65 index into the table is test code: EQ, NE, ... LT, GT, AL, NV
66 bit position in short is condition code: NZCV */
67static const unsigned short aCC[16] = {
68 0xF0F0, // EQ == Z set
69 0x0F0F, // NE
70 0xCCCC, // CS == C set
71 0x3333, // CC
72 0xFF00, // MI == N set
73 0x00FF, // PL
74 0xAAAA, // VS == V set
75 0x5555, // VC
76 0x0C0C, // HI == C set && Z clear
77 0xF3F3, // LS == C clear || Z set
78 0xAA55, // GE == (N==V)
79 0x55AA, // LT == (N!=V)
80 0x0A05, // GT == (!Z && (N==V))
81 0xF5FA, // LE == (Z || (N!=V))
82 0xFFFF, // AL always
83 0 // NV
84};
85
86unsigned int checkCondition(const unsigned int opcode, const unsigned int ccodes)
87{
88 return (aCC[opcode >> 28] >> (ccodes >> 28)) & 1;
89}
diff --git a/arch/arm/nwfpe/fpopcode.h b/arch/arm/nwfpe/fpopcode.h
index 786e4c96156..78f02dbfaa8 100644
--- a/arch/arm/nwfpe/fpopcode.h
+++ b/arch/arm/nwfpe/fpopcode.h
@@ -475,9 +475,6 @@ static inline unsigned int getDestinationSize(const unsigned int opcode)
475 return (nRc); 475 return (nRc);
476} 476}
477 477
478extern unsigned int checkCondition(const unsigned int opcode,
479 const unsigned int ccodes);
480
481extern const float64 float64Constant[]; 478extern const float64 float64Constant[];
482extern const float32 float32Constant[]; 479extern const float32 float32Constant[];
483 480