aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/nwfpe/extended_cpdo.c
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2005-08-03 14:49:17 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-08-03 14:49:17 -0400
commitf148af2593ef76ac705d1cc6abe48f455c9912cc (patch)
treecd1e0b0959624234ca3489df8888434ffea5050e /arch/arm/nwfpe/extended_cpdo.c
parent1fcf844861eb08ee05e05dba13b5436f2f2e29ed (diff)
[PATCH] ARM: 2837/2: Re: ARM: Make NWFPE preempt safe
Patch from Richard Purdie NWFPE used global variables which meant it wasn't safe for use with preemptive kernels. This patch removes them and communicates the information between functions in a preempt safe manner. Generation of some exceptions was broken and this has also been corrected. Tests with glibc's maths test suite show no change in the results before/after this patch. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/nwfpe/extended_cpdo.c')
-rw-r--r--arch/arm/nwfpe/extended_cpdo.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/arch/arm/nwfpe/extended_cpdo.c b/arch/arm/nwfpe/extended_cpdo.c
index c39f68a3449e..65a279ba927f 100644
--- a/arch/arm/nwfpe/extended_cpdo.c
+++ b/arch/arm/nwfpe/extended_cpdo.c
@@ -35,17 +35,17 @@ floatx80 floatx80_arccos(floatx80 rFm);
35floatx80 floatx80_pow(floatx80 rFn, floatx80 rFm); 35floatx80 floatx80_pow(floatx80 rFn, floatx80 rFm);
36floatx80 floatx80_pol(floatx80 rFn, floatx80 rFm); 36floatx80 floatx80_pol(floatx80 rFn, floatx80 rFm);
37 37
38static floatx80 floatx80_rsf(floatx80 rFn, floatx80 rFm) 38static floatx80 floatx80_rsf(struct roundingData *roundData, floatx80 rFn, floatx80 rFm)
39{ 39{
40 return floatx80_sub(rFm, rFn); 40 return floatx80_sub(roundData, rFm, rFn);
41} 41}
42 42
43static floatx80 floatx80_rdv(floatx80 rFn, floatx80 rFm) 43static floatx80 floatx80_rdv(struct roundingData *roundData, floatx80 rFn, floatx80 rFm)
44{ 44{
45 return floatx80_div(rFm, rFn); 45 return floatx80_div(roundData, rFm, rFn);
46} 46}
47 47
48static floatx80 (*const dyadic_extended[16])(floatx80 rFn, floatx80 rFm) = { 48static floatx80 (*const dyadic_extended[16])(struct roundingData*, floatx80 rFn, floatx80 rFm) = {
49 [ADF_CODE >> 20] = floatx80_add, 49 [ADF_CODE >> 20] = floatx80_add,
50 [MUF_CODE >> 20] = floatx80_mul, 50 [MUF_CODE >> 20] = floatx80_mul,
51 [SUF_CODE >> 20] = floatx80_sub, 51 [SUF_CODE >> 20] = floatx80_sub,
@@ -60,24 +60,24 @@ static floatx80 (*const dyadic_extended[16])(floatx80 rFn, floatx80 rFm) = {
60 [FRD_CODE >> 20] = floatx80_rdv, 60 [FRD_CODE >> 20] = floatx80_rdv,
61}; 61};
62 62
63static floatx80 floatx80_mvf(floatx80 rFm) 63static floatx80 floatx80_mvf(struct roundingData *roundData, floatx80 rFm)
64{ 64{
65 return rFm; 65 return rFm;
66} 66}
67 67
68static floatx80 floatx80_mnf(floatx80 rFm) 68static floatx80 floatx80_mnf(struct roundingData *roundData, floatx80 rFm)
69{ 69{
70 rFm.high ^= 0x8000; 70 rFm.high ^= 0x8000;
71 return rFm; 71 return rFm;
72} 72}
73 73
74static floatx80 floatx80_abs(floatx80 rFm) 74static floatx80 floatx80_abs(struct roundingData *roundData, floatx80 rFm)
75{ 75{
76 rFm.high &= 0x7fff; 76 rFm.high &= 0x7fff;
77 return rFm; 77 return rFm;
78} 78}
79 79
80static floatx80 (*const monadic_extended[16])(floatx80 rFm) = { 80static floatx80 (*const monadic_extended[16])(struct roundingData*, floatx80 rFm) = {
81 [MVF_CODE >> 20] = floatx80_mvf, 81 [MVF_CODE >> 20] = floatx80_mvf,
82 [MNF_CODE >> 20] = floatx80_mnf, 82 [MNF_CODE >> 20] = floatx80_mnf,
83 [ABS_CODE >> 20] = floatx80_abs, 83 [ABS_CODE >> 20] = floatx80_abs,
@@ -87,7 +87,7 @@ static floatx80 (*const monadic_extended[16])(floatx80 rFm) = {
87 [NRM_CODE >> 20] = floatx80_mvf, 87 [NRM_CODE >> 20] = floatx80_mvf,
88}; 88};
89 89
90unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd) 90unsigned int ExtendedCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd)
91{ 91{
92 FPA11 *fpa11 = GET_FPA11(); 92 FPA11 *fpa11 = GET_FPA11();
93 floatx80 rFm; 93 floatx80 rFm;
@@ -138,13 +138,13 @@ unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd)
138 } 138 }
139 139
140 if (dyadic_extended[opc_mask_shift]) { 140 if (dyadic_extended[opc_mask_shift]) {
141 rFd->fExtended = dyadic_extended[opc_mask_shift](rFn, rFm); 141 rFd->fExtended = dyadic_extended[opc_mask_shift](roundData, rFn, rFm);
142 } else { 142 } else {
143 return 0; 143 return 0;
144 } 144 }
145 } else { 145 } else {
146 if (monadic_extended[opc_mask_shift]) { 146 if (monadic_extended[opc_mask_shift]) {
147 rFd->fExtended = monadic_extended[opc_mask_shift](rFm); 147 rFd->fExtended = monadic_extended[opc_mask_shift](roundData, rFm);
148 } else { 148 } else {
149 return 0; 149 return 0;
150 } 150 }