From d203b41ac79b011d63bc1e2467f9c8a81f468eed Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 20 Aug 2018 09:22:28 +0930 Subject: Tidy bit twiddling * sh-opc.h (MASK): Simplify. --- opcodes/sh-opc.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'opcodes/sh-opc.h') 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) -- cgit v1.1