[PATCH] PowerPC improve support for Gekko & Broadway

Alan Modra amodra@gmail.com
Fri Jul 27 00:14:00 GMT 2018


On Thu, Jul 26, 2018 at 03:32:37PM -0400, Sergio Durigan Junior wrote:
> This patch has caused a build breakage on i686:
> 
> https://gdb-build.sergiodj.net/builders/Fedora-i686/builds/10499/steps/compile%20gdb/logs/stdio

PowerPC has replaced use of "long" for insns with "int64_t", in
preparation for 64-bit power10 insns.

	* ppc-opc.c (insert_sprbat): Correct function parameter and
	return type.
	(extract_sprbat): Likewise, variable too.

diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
index 03891a4718..df2f0cda4b 100644
--- a/opcodes/ppc-opc.c
+++ b/opcodes/ppc-opc.c
@@ -1190,9 +1190,9 @@ extract_spr (uint64_t insn,
 /* Some dialects have 8 [DI]BAT registers instead of the standard 4.  */
 #define ALLOW8_BAT (PPC_OPCODE_750)
 
-static unsigned long
-insert_sprbat (unsigned long insn,
-	       long value,
+static uint64_t
+insert_sprbat (uint64_t insn,
+	       int64_t value,
 	       ppc_cpu_t dialect,
 	       const char **errmsg)
 {
@@ -1209,12 +1209,12 @@ insert_sprbat (unsigned long insn,
   return insn | (value << 11);
 }
 
-static long
-extract_sprbat (unsigned long insn,
+static int64_t
+extract_sprbat (uint64_t insn,
 		ppc_cpu_t dialect,
 		int *invalid)
 {
-  unsigned long val = (insn >> 17) & 0x3;
+  uint64_t val = (insn >> 17) & 0x3;
 
   val = val + ((insn >> 9) & 0x4);
   if (val > 3 && (dialect & ALLOW8_BAT) == 0)

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list