summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/fpu
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-26 20:33:21 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-26 20:33:21 +0000
commitadaa84b5b57cf328ccf6e345b38ec6706c692895 (patch)
tree7981ac434a72299baff1a6d37d0dc095dac8ffec /sys/arch/sparc64/fpu
parenta259a6aeceab099f25670e0fbdd7d90fa1ec9bfa (diff)
1 << 31 cleanup. Eitan Adler pointed out that there has been a
resurrection of the bad idiom in the tree. sufficient review by miod, kettenis, tedu
Diffstat (limited to 'sys/arch/sparc64/fpu')
-rw-r--r--sys/arch/sparc64/fpu/fpu.c6
-rw-r--r--sys/arch/sparc64/fpu/fpu_div.c6
-rw-r--r--sys/arch/sparc64/fpu/fpu_sqrt.c10
3 files changed, 11 insertions, 11 deletions
diff --git a/sys/arch/sparc64/fpu/fpu.c b/sys/arch/sparc64/fpu/fpu.c
index c82af1be713..2a9b7f10ff8 100644
--- a/sys/arch/sparc64/fpu/fpu.c
+++ b/sys/arch/sparc64/fpu/fpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpu.c,v 1.17 2011/07/11 15:40:47 guenther Exp $ */
+/* $OpenBSD: fpu.c,v 1.18 2013/11/26 20:33:15 deraadt Exp $ */
/* $NetBSD: fpu.c,v 1.11 2000/12/06 01:47:50 mrg Exp $ */
/*
@@ -499,7 +499,7 @@ fpu_insn_fabs(fs, fe, instr)
if ((rd = fpu_regoffset(instr.i_opf.i_rd, rtype)) < 0)
return (NOTFPU);
fpu_fcopy(fs->fs_regs + rs, fs->fs_regs + rd, rtype);
- fs->fs_regs[rd] = fs->fs_regs[rd] & ~(1 << 31);
+ fs->fs_regs[rd] = fs->fs_regs[rd] & ~(1U << 31);
fs->fs_fsr = fe->fe_fsr;
return (0);
}
@@ -523,7 +523,7 @@ fpu_insn_fneg(fs, fe, instr)
if ((rd = fpu_regoffset(instr.i_opf.i_rd, rtype)) < 0)
return (NOTFPU);
fpu_fcopy(fs->fs_regs + rs, fs->fs_regs + rd, rtype);
- fs->fs_regs[rd] = fs->fs_regs[rd] ^ (1 << 31);
+ fs->fs_regs[rd] = fs->fs_regs[rd] ^ (1U << 31);
fs->fs_fsr = fe->fe_fsr;
return (0);
}
diff --git a/sys/arch/sparc64/fpu/fpu_div.c b/sys/arch/sparc64/fpu/fpu_div.c
index dce066765c5..9e02cb57e03 100644
--- a/sys/arch/sparc64/fpu/fpu_div.c
+++ b/sys/arch/sparc64/fpu/fpu_div.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpu_div.c,v 1.2 2003/06/02 23:27:55 millert Exp $ */
+/* $OpenBSD: fpu_div.c,v 1.3 2013/11/26 20:33:15 deraadt Exp $ */
/* $NetBSD: fpu_div.c,v 1.2 1994/11/20 20:52:38 deraadt Exp $ */
/*
@@ -129,7 +129,7 @@
* } while ((bit >>= 1) != 0);
* Q[0] = q;
* for (i = 1; i < 4; i++) {
- * q = 0, bit = 1 << 31;
+ * q = 0, bit = 1U << 31;
* do {
* D = R - Y;
* if (D >= 0) {
@@ -228,7 +228,7 @@ fpu_div(fe)
#define WORD(r, i) /* calculate r->fp_mant[i] */ \
q = 0; \
- bit = 1 << 31; \
+ bit = 1U << 31; \
LOOP; \
(x)->fp_mant[i] = q
diff --git a/sys/arch/sparc64/fpu/fpu_sqrt.c b/sys/arch/sparc64/fpu/fpu_sqrt.c
index c8c1df9d876..720759b78de 100644
--- a/sys/arch/sparc64/fpu/fpu_sqrt.c
+++ b/sys/arch/sparc64/fpu/fpu_sqrt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpu_sqrt.c,v 1.2 2003/06/02 23:27:55 millert Exp $ */
+/* $OpenBSD: fpu_sqrt.c,v 1.3 2013/11/26 20:33:15 deraadt Exp $ */
/* $NetBSD: fpu_sqrt.c,v 1.2 1994/11/20 20:52:46 deraadt Exp $ */
/*
@@ -254,7 +254,7 @@ fpu_sqrt(fe)
* double x correctly while doing the `known q=1.0'.
*
* We do this one mantissa-word at a time, as noted above, to
- * save work. To avoid `(1 << 31) << 1', we also do the top bit
+ * save work. To avoid `(1U << 31) << 1', we also do the top bit
* outside of each per-word loop.
*
* The calculation `t = y + bit' breaks down into `t0 = y0, ...,
@@ -292,7 +292,7 @@ fpu_sqrt(fe)
#define t1 tt
q = 0;
y1 = 0;
- bit = 1 << 31;
+ bit = 1U << 31;
EVEN_DOUBLE;
t1 = bit;
FPU_SUBS(d1, x1, t1);
@@ -323,7 +323,7 @@ fpu_sqrt(fe)
#define t2 tt
q = 0;
y2 = 0;
- bit = 1 << 31;
+ bit = 1U << 31;
EVEN_DOUBLE;
t2 = bit;
FPU_SUBS(d2, x2, t2);
@@ -356,7 +356,7 @@ fpu_sqrt(fe)
#define t3 tt
q = 0;
y3 = 0;
- bit = 1 << 31;
+ bit = 1U << 31;
EVEN_DOUBLE;
t3 = bit;
FPU_SUBS(d3, x3, t3);