summaryrefslogtreecommitdiffstats
path: root/arch/alpha/math-emu
diff options
context:
space:
mode:
Diffstat (limited to 'arch/alpha/math-emu')
-rw-r--r--arch/alpha/math-emu/fp-emul.c4
-rw-r--r--arch/alpha/math-emu/ieee-math.c21
-rw-r--r--arch/alpha/math-emu/ieee-math.h2
3 files changed, 14 insertions, 13 deletions
diff --git a/arch/alpha/math-emu/fp-emul.c b/arch/alpha/math-emu/fp-emul.c
index 122ec85ac..c2ebbbb60 100644
--- a/arch/alpha/math-emu/fp-emul.c
+++ b/arch/alpha/math-emu/fp-emul.c
@@ -107,7 +107,7 @@ long
alpha_fp_emul (unsigned long pc)
{
unsigned long op_fun, fa, fb, fc, func, mode;
- unsigned long fpcw = current->tss.flags;
+ unsigned long fpcw = current->thread.flags;
unsigned long va, vb, vc, res, fpcr;
__u32 insn;
@@ -255,7 +255,7 @@ alpha_fp_emul (unsigned long pc)
*/
if (res) {
/* Record exceptions in software control word. */
- current->tss.flags = fpcw |= res >> 35;
+ current->thread.flags = fpcw |= res >> 35;
/* Update hardware control register */
fpcr &= (~FPCR_MASK | FPCR_DYN_MASK);
diff --git a/arch/alpha/math-emu/ieee-math.c b/arch/alpha/math-emu/ieee-math.c
index 224fdd2b7..9a86b1048 100644
--- a/arch/alpha/math-emu/ieee-math.c
+++ b/arch/alpha/math-emu/ieee-math.c
@@ -704,20 +704,21 @@ ieee_CVTQS (int f, unsigned long a, unsigned long *b)
* FPCR_INV if invalid operation occurred, etc.
*/
unsigned long
-ieee_CVTQT (int f, unsigned long a, unsigned long *b)
+ieee_CVTQT (int f, long a, unsigned long *b)
{
EXTENDED op_b;
- op_b.s = 0;
- op_b.f[0] = a;
- op_b.f[1] = 0;
- if (sign(a) < 0) {
- op_b.s = 1;
- op_b.f[0] = -a;
+ if (a != 0) {
+ op_b.s = (a < 0 ? 1 : 0);
+ op_b.f[0] = (a < 0 ? -a : a);
+ op_b.f[1] = 0;
+ op_b.e = 55;
+ normalize(&op_b);
+ return round_t_ieee(f, &op_b, b);
+ } else {
+ *b = 0;
+ return 0;
}
- op_b.e = 55;
- normalize(&op_b);
- return round_t_ieee(f, &op_b, b);
}
diff --git a/arch/alpha/math-emu/ieee-math.h b/arch/alpha/math-emu/ieee-math.h
index 1b3cf2694..076a6d1c8 100644
--- a/arch/alpha/math-emu/ieee-math.h
+++ b/arch/alpha/math-emu/ieee-math.h
@@ -20,7 +20,7 @@
extern unsigned long ieee_CVTST (int rm, unsigned long a, unsigned long *b);
extern unsigned long ieee_CVTTS (int rm, unsigned long a, unsigned long *b);
extern unsigned long ieee_CVTQS (int rm, unsigned long a, unsigned long *b);
-extern unsigned long ieee_CVTQT (int rm, unsigned long a, unsigned long *b);
+extern unsigned long ieee_CVTQT (int rm, long a, unsigned long *b);
extern unsigned long ieee_CVTTQ (int rm, unsigned long a, unsigned long *b);
extern unsigned long ieee_CMPTEQ (unsigned long a, unsigned long b,