public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [RFA] PowerPC VLE port - MIN_INSN_LENGTH
@ 2012-07-30 15:09 James Lemke
  2012-07-31 23:11 ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: James Lemke @ 2012-07-30 15:09 UTC (permalink / raw)
  To: binutils; +Cc: Catherine Moore

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

I had not submitted my DWARF2_LINE_MIN_INSN_LENGTH changes which should
be 2 for VLE code but otherwise left as 4.

This is the last of the binutils changes I have for VLE.

A bootstrap was successful and I have run the dejagnu suite.  There were no
regressions in any of binutils, gas, ld, gcc, g++, gfortran.

OK to commit?

-- 
Jim Lemke
Mentor Graphics / CodeSourcery
Orillia Ontario,  +1-613-963-1073



[-- Attachment #2: vle-binutils-contrib-20120730b.diff --]
[-- Type: text/x-patch, Size: 5683 bytes --]

gas/ChangeLog:
2012-07-30  James Lemke  <jwlemke@codesourcery.com>

	* gas/dwarf2dbg.c (out_set_addr): Allow for non-constant value of
	DWARF2_LINE_MIN_INSN_LENGTH
	* gas/config/tc-ppc.c (ppc_dwarf2_line_min_insn_length): Declare
	and initialize.
	(md_apply_fix): Branch addr can be a multiple of 2 or 4.
	* gas/config/tc-ppc.h (DWARF2_LINE_MIN_INSN_LENGTH): Now a
	variable reference.

gas/testsuite/ChangeLog:
2012-07-30  James Lemke  <jwlemke@codesourcery.com>

	* gas/cfi/cfi-ppc-1.d: Allow for code alignment of 2 or 4.

ld/ChangeLog:
2012-07-30  James Lemke  <jwlemke@codesourcery.com>

	* ld/testsuite/ld-gc/pr13683.d: XFAIL for powerpc*-*-eabivle.

Index: gas/dwarf2dbg.c
===================================================================
RCS file: /cvs/src/src/gas/dwarf2dbg.c,v
retrieving revision 1.116
diff -u -p -r1.116 dwarf2dbg.c
--- gas/dwarf2dbg.c	28 Jun 2012 11:31:13 -0000	1.116
+++ gas/dwarf2dbg.c	30 Jul 2012 14:47:15 -0000
@@ -882,24 +882,22 @@ out_set_addr (symbolS *sym)
   emit_expr (&exp, sizeof_address);
 }
 
-#if DWARF2_LINE_MIN_INSN_LENGTH > 1
 static void scale_addr_delta (addressT *);
 
 static void
 scale_addr_delta (addressT *addr_delta)
 {
   static int printed_this = 0;
-  if (*addr_delta % DWARF2_LINE_MIN_INSN_LENGTH != 0)
+  if (DWARF2_LINE_MIN_INSN_LENGTH > 1)
     {
-      if (!printed_this)
-	as_bad("unaligned opcodes detected in executable segment");
-      printed_this = 1;
+      if (*addr_delta % DWARF2_LINE_MIN_INSN_LENGTH != 0  && !printed_this)
+        {
+	  as_bad("unaligned opcodes detected in executable segment");
+          printed_this = 1;
+        }
+      *addr_delta /= DWARF2_LINE_MIN_INSN_LENGTH;
     }
-  *addr_delta /= DWARF2_LINE_MIN_INSN_LENGTH;
 }
-#else
-#define scale_addr_delta(A)
-#endif
 
 /* Encode a pair of line and address skips as efficiently as possible.
    Note that the line skip is signed, whereas the address skip is unsigned.
Index: gas/config/tc-ppc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ppc.c,v
retrieving revision 1.184
diff -u -p -r1.184 tc-ppc.c
--- gas/config/tc-ppc.c	18 May 2012 05:42:24 -0000	1.184
+++ gas/config/tc-ppc.c	30 Jul 2012 14:47:15 -0000
@@ -213,6 +213,9 @@ const char ppc_symbol_chars[] = "%[";
 /* The dwarf2 data alignment, adjusted for 32 or 64 bit.  */
 int ppc_cie_data_alignment;
 
+/* The dwarf2 minimum instruction length.  */
+int ppc_dwarf2_line_min_insn_length;
+
 /* More than this number of nops in an alignment op gets a branch
    instead.  */
 unsigned long nop_limit = 4;
@@ -1695,6 +1698,7 @@ md_begin (void)
   ppc_set_cpu ();
 
   ppc_cie_data_alignment = ppc_obj64 ? -8 : -4;
+  ppc_dwarf2_line_min_insn_length = (ppc_cpu & PPC_OPCODE_VLE) ? 2 : 4;
 
 #ifdef OBJ_ELF
   /* Set the ELF flags if desired.  */
@@ -6882,9 +6886,18 @@ md_apply_fix (fixS *fixP, valueT *valP, 
 		insn = bfd_getb32 ((unsigned char *) where);
 	      else
 		insn = bfd_getl32 ((unsigned char *) where);
-	      if ((value & 3) != 0)
-		as_bad_where (fixP->fx_file, fixP->fx_line,
-			      _("must branch to an address a multiple of 4"));
+	      if (ppc_mach() == bfd_mach_ppc_vle)
+		{
+		  if ((value & 1) != 0)
+		    as_bad_where (fixP->fx_file, fixP->fx_line,
+			          _("branch address must be a multiple of 2"));
+		}
+	      else
+		{
+		  if ((value & 3) != 0)
+		    as_bad_where (fixP->fx_file, fixP->fx_line,
+			          _("branch address must be a multiple of 4"));
+		}
 	      if ((offsetT) value < -0x40000000
 		  || (offsetT) value >= 0x40000000)
 		as_bad_where (fixP->fx_file, fixP->fx_line,
Index: gas/config/tc-ppc.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ppc.h,v
retrieving revision 1.45
diff -u -p -r1.45 tc-ppc.h
--- gas/config/tc-ppc.h	14 May 2012 19:45:23 -0000	1.45
+++ gas/config/tc-ppc.h	30 Jul 2012 14:47:15 -0000
@@ -270,6 +270,8 @@ extern int tc_ppc_regname_to_dw2regnum (
 
 extern int ppc_cie_data_alignment;
 
-#define DWARF2_LINE_MIN_INSN_LENGTH     4
+extern int ppc_dwarf2_line_min_insn_length;
+
+#define DWARF2_LINE_MIN_INSN_LENGTH     ppc_dwarf2_line_min_insn_length
 #define DWARF2_DEFAULT_RETURN_COLUMN    0x41
 #define DWARF2_CIE_DATA_ALIGNMENT       ppc_cie_data_alignment

Index: gas/testsuite/gas/cfi/cfi-ppc-1.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/cfi/cfi-ppc-1.d,v
retrieving revision 1.3
diff -u -p -r1.3 cfi-ppc-1.d
--- gas/testsuite/gas/cfi/cfi-ppc-1.d	6 Oct 2008 16:27:34 -0000	1.3
+++ gas/testsuite/gas/cfi/cfi-ppc-1.d	30 Jul 2012 14:47:15 -0000
@@ -7,7 +7,7 @@ Contents of the .eh_frame section:
 00000000 00000010 00000000 CIE
   Version:               1
   Augmentation:          "zR"
-  Code alignment factor: 4
+  Code alignment factor: [24]
   Data alignment factor: -4
   Return address column: 65
   Augmentation data:     1b
Index: ld/testsuite/ld-gc/pr13683.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-gc/pr13683.d,v
retrieving revision 1.3
diff -u -p -r1.3 pr13683.d
--- ld/testsuite/ld-gc/pr13683.d	16 Mar 2012 00:20:58 -0000	1.3
+++ ld/testsuite/ld-gc/pr13683.d	30 Jul 2012 14:47:17 -0000
@@ -2,7 +2,7 @@
 #source: dummy.s
 #ld: --gc-sections -e main --defsym foo=foo2 tmpdir/pr13683.o
 #nm: --format=bsd
-#xfail: sh64*-*-* iq2000-*-* lm32-*-* epiphany-*-* mips64vr-*-* frv-*-* m32c-*-* rl78-*-* rx-*-* sh-*-*
+#xfail: sh64*-*-* iq2000-*-* lm32-*-* epiphany-*-* mips64vr-*-* frv-*-* m32c-*-* rl78-*-* rx-*-* sh-*-* powerpc*-*-eabivle
 
 # Note - look for both "foo" and "foo2" being defined, non-zero function symbols
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] PowerPC VLE port - MIN_INSN_LENGTH
  2012-07-30 15:09 [RFA] PowerPC VLE port - MIN_INSN_LENGTH James Lemke
@ 2012-07-31 23:11 ` Alan Modra
  2012-08-01 16:03   ` H.J. Lu
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2012-07-31 23:11 UTC (permalink / raw)
  To: James Lemke; +Cc: binutils, Catherine Moore

On Mon, Jul 30, 2012 at 11:08:59AM -0400, James Lemke wrote:
> gas/ChangeLog:
> 2012-07-30  James Lemke  <jwlemke@codesourcery.com>
> 
> 	* gas/dwarf2dbg.c (out_set_addr): Allow for non-constant value of
> 	DWARF2_LINE_MIN_INSN_LENGTH
> 	* gas/config/tc-ppc.c (ppc_dwarf2_line_min_insn_length): Declare
> 	and initialize.
> 	(md_apply_fix): Branch addr can be a multiple of 2 or 4.
> 	* gas/config/tc-ppc.h (DWARF2_LINE_MIN_INSN_LENGTH): Now a
> 	variable reference.
> 
> gas/testsuite/ChangeLog:
> 2012-07-30  James Lemke  <jwlemke@codesourcery.com>
> 
> 	* gas/cfi/cfi-ppc-1.d: Allow for code alignment of 2 or 4.
> 
> ld/ChangeLog:
> 2012-07-30  James Lemke  <jwlemke@codesourcery.com>
> 
> 	* ld/testsuite/ld-gc/pr13683.d: XFAIL for powerpc*-*-eabivle.

OK.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] PowerPC VLE port - MIN_INSN_LENGTH
  2012-07-31 23:11 ` Alan Modra
@ 2012-08-01 16:03   ` H.J. Lu
  2012-08-01 16:41     ` James Lemke
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2012-08-01 16:03 UTC (permalink / raw)
  To: James Lemke, binutils, Catherine Moore

On Tue, Jul 31, 2012 at 4:11 PM, Alan Modra <amodra@gmail.com> wrote:
> On Mon, Jul 30, 2012 at 11:08:59AM -0400, James Lemke wrote:
>> gas/ChangeLog:
>> 2012-07-30  James Lemke  <jwlemke@codesourcery.com>
>>
>>       * gas/dwarf2dbg.c (out_set_addr): Allow for non-constant value of
             ^^^^^  "gas/" should be removed.

>>       DWARF2_LINE_MIN_INSN_LENGTH
>>       * gas/config/tc-ppc.c (ppc_dwarf2_line_min_insn_length): Declare
>>       and initialize.
>>       (md_apply_fix): Branch addr can be a multiple of 2 or 4.
>>       * gas/config/tc-ppc.h (DWARF2_LINE_MIN_INSN_LENGTH): Now a
>>       variable reference.
>>
>> gas/testsuite/ChangeLog:
>> 2012-07-30  James Lemke  <jwlemke@codesourcery.com>
>>
>>       * gas/cfi/cfi-ppc-1.d: Allow for code alignment of 2 or 4.
>>
>> ld/ChangeLog:
>> 2012-07-30  James Lemke  <jwlemke@codesourcery.com>
>>
>>       * ld/testsuite/ld-gc/pr13683.d: XFAIL for powerpc*-*-eabivle.
>

Wrong ChangeLog file.  It should be ld/testsuite/ChangeLog.

I have fixed them.

-- 
H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] PowerPC VLE port - MIN_INSN_LENGTH
  2012-08-01 16:03   ` H.J. Lu
@ 2012-08-01 16:41     ` James Lemke
  0 siblings, 0 replies; 4+ messages in thread
From: James Lemke @ 2012-08-01 16:41 UTC (permalink / raw)
  To: H.J. Lu; +Cc: binutils, Catherine Moore

On 08/01/2012 12:03 PM, H.J. Lu wrote:
> Wrong ChangeLog file.  It should be ld/testsuite/ChangeLog.
>
> I have fixed them.

Yes, thanks.

-- 
Jim Lemke
Mentor Graphics / CodeSourcery
Orillia Ontario,  +1-613-963-1073

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-01 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-30 15:09 [RFA] PowerPC VLE port - MIN_INSN_LENGTH James Lemke
2012-07-31 23:11 ` Alan Modra
2012-08-01 16:03   ` H.J. Lu
2012-08-01 16:41     ` James Lemke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).