Blame SOURCES/gdb-rhbz1125820-ppc64le-enablement-27of37.patch

01917d
commit 5b757e5ddbd9ad252d9c51103f1aa52b41c2e947
01917d
Author: Ulrich Weigand <ulrich.weigand@de.ibm.com>
01917d
Date:   Tue Feb 4 18:33:04 2014 +0100
01917d
01917d
    PowerPC64 little-endian fixes: 32-bit DFP parameters
01917d
    
01917d
    Passing a 32-bit DFP in register needs to use the least-significant part
01917d
    of the register.  Like with a previous patch that addressed the same
01917d
    issue for small structs, this patch makes sure the appropriate offset
01917d
    is used on little-endian systems.
01917d
    
01917d
    gdb/ChangeLog:
01917d
    
01917d
    	* ppc-sysv-tdep.c (ppc64_sysv_abi_push_freg): Use correct
01917d
    	offset on little-endian when passing _Decimal32.
01917d
    	(ppc64_sysv_abi_return_value_base): Likewise for return values.
01917d
01917d
Index: gdb-7.6.1/gdb/ppc-sysv-tdep.c
01917d
===================================================================
01917d
--- gdb-7.6.1.orig/gdb/ppc-sysv-tdep.c
01917d
+++ gdb-7.6.1/gdb/ppc-sysv-tdep.c
01917d
@@ -1231,7 +1231,10 @@ ppc64_sysv_abi_push_freg (struct gdbarch
01917d
       if (argpos->regcache && argpos->freg <= 13)
01917d
 	{
01917d
 	  int regnum = tdep->ppc_fp0_regnum + argpos->freg;
01917d
-	  int offset = 8 - TYPE_LENGTH (type);
01917d
+	  int offset = 0;
01917d
+
01917d
+	  if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
01917d
+	    offset = 8 - TYPE_LENGTH (type);
01917d
 
01917d
 	  regcache_cooked_write_part (argpos->regcache, regnum,
01917d
 				      offset, TYPE_LENGTH (type), val);
01917d
@@ -1640,7 +1643,10 @@ ppc64_sysv_abi_return_value_base (struct
01917d
       && TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT)
01917d
     {
01917d
       int regnum = tdep->ppc_fp0_regnum + 1 + index;
01917d
-      int offset = 8 - TYPE_LENGTH (valtype);
01917d
+      int offset = 0;
01917d
+
01917d
+      if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
01917d
+	offset = 8 - TYPE_LENGTH (valtype);
01917d
 
01917d
       if (writebuf != NULL)
01917d
 	regcache_cooked_write_part (regcache, regnum,