aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-08-20 09:22:28 +0930
committerAlan Modra <amodra@gmail.com>2018-08-20 09:54:20 +0930
commitd203b41ac79b011d63bc1e2467f9c8a81f468eed (patch)
tree6cb2b5608231ae991f4521aa209599df9708b40b /opcodes
parentba1c4c6fee7e8794481412fd8604462f04b2765f (diff)
downloadbinutils-d203b41ac79b011d63bc1e2467f9c8a81f468eed.zip
binutils-d203b41ac79b011d63bc1e2467f9c8a81f468eed.tar.gz
binutils-d203b41ac79b011d63bc1e2467f9c8a81f468eed.tar.bz2
Tidy bit twiddling
* sh-opc.h (MASK): Simplify.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog17
-rw-r--r--opcodes/sh-opc.h5
2 files changed, 12 insertions, 10 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 79f52cf..137e34c 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,12 +1,17 @@
-2018-07-28 John Darrington <john@darrington.wattle.id.au>
+2018-08-20 Alan Modra <amodra@gmail.com>
- * s12z-dis.c (bm_decode): Deal with cases where the mode is BM_RESERVED0 or BM_RESERVED1
- * s12z-dis.c (bm_rel_decode): ditto
- * s12z-dis.c (bm_n_bytes): ditto
+ * sh-opc.h (MASK): Simplify.
-2018-07-28 John Darrington <john@darrington.wattle.id.au>
+2018-07-28 John Darrington <john@darrington.wattle.id.au>
- * s12z.h: Delete.
+ * s12z-dis.c (bm_decode): Deal with cases where the mode is
+ BM_RESERVED0 or BM_RESERVED1
+ * s12z-dis.c (bm_rel_decode): ditto
+ * s12z-dis.c (bm_n_bytes): ditto
+
+2018-07-28 John Darrington <john@darrington.wattle.id.au>
+
+ * s12z.h: Delete.
2018-08-14 H.J. Lu <hongjiu.lu@intel.com>
diff --git a/opcodes/sh-opc.h b/opcodes/sh-opc.h
index 13d6056..1ddb36c 100644
--- a/opcodes/sh-opc.h
+++ b/opcodes/sh-opc.h
@@ -205,10 +205,7 @@ typedef enum
sh_dsp_reg_nums;
/* Return a mask with bits LO to HI (inclusive) set. */
-#define MASK(LO,HI) ( LO < 1 ? ((1U << (HI + 1)) - 1) \
- : HI > 30 ? (-1U << LO) \
- : LO == HI ? (1U << LO) \
- : (((1U << (HI + 1)) - 1) & (-1U << LO)))
+#define MASK(LO,HI) ((1U << (HI) << 1) - (1U << (LO)))
#define arch_sh1_base (1 << 0)
#define arch_sh2_base (1 << 1)