This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] sh: make constant unsigned to avoid narrowing
- From: tbsaunde+binutils at tbsaunde dot org
- To: binutils at sourceware dot org
- Cc: Trevor Saunders <tbsaunde+binutils at tbsaunde dot org>
- Date: Tue, 31 May 2016 08:28:07 -0400
- Subject: [PATCH] sh: make constant unsigned to avoid narrowing
- Authentication-results: sourceware.org; auth=none
From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
Hi,
Shifting into the sign bit of a 32 bit int and then converting to a unsigned
type is less straight forward than just shifting an unsigned value.
built and regtested sh-elf, ok?
Thanks!
Trev
opcodes/ChangeLog:
2016-05-31 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* sh-opc.h (ARCH_SH_HAS_DSP): Make the shifted value an unsigned
constant.
---
opcodes/sh-opc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/opcodes/sh-opc.h b/opcodes/sh-opc.h
index b2bbbfd..46ce5ab 100644
--- a/opcodes/sh-opc.h
+++ b/opcodes/sh-opc.h
@@ -230,7 +230,7 @@ sh_dsp_reg_nums;
#define arch_sh_no_co (1 << 28) /* Neither FPU nor DSP co-processor. */
#define arch_sh_sp_fpu (1 << 29) /* Single precision FPU. */
#define arch_sh_dp_fpu (1 << 30) /* Double precision FPU. */
-#define arch_sh_has_dsp (1 << 31)
+#define arch_sh_has_dsp (1u << 31)
#define arch_sh_co_mask MASK (28, 31)
--
2.7.4