This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Xtensa states with the shared_or attribute


Certain Xtensa configurations allow certain states to be written by
multiple opcodes within the same FLIX bundle. However, the current
assembler prohibits this. This patch introduces a function that detects
these states, and into gas code to allow such bundles where it once
rejected them.

I see no unexpected failures when I run the gas testsuite 

Sterling

bfd/ChangeLog
2008-11-19  Sterling Augustine  <sterling@tensilica.com>

	* xtensa-isa.c (xtensa_state_is_shared_or): New function.
	
gas/ChangeLog
2008-11-19  Sterling Augustine  <sterling@tensilica.com>

	* config/tc-xtensa.c: (check_t1_t2_reads_and_writes): Call
	xtensa_state_is_shared_or to allow multiple opcodes within a
	single FLIX bundle to write to these special states.

include/ChangeLog
2008-11-19  Sterling Augustine  <sterling@tensilica.com>

	* xtensa-isa-internal.h: (XTENSA_STATE_IS_SHARED_OR): New flag.
	* xtensa-isa.h: (xtensa_state_is_shared_or): New prototype.
	
	

Index: bfd/xtensa-isa.c
===================================================================
RCS file: /cvs/src/src/bfd/xtensa-isa.c,v
retrieving revision 1.11
diff -u -r1.11 xtensa-isa.c
--- bfd/xtensa-isa.c	3 Mar 2008 23:23:40 -0000	1.11
+++ bfd/xtensa-isa.c	19 Nov 2008 22:25:26 -0000
@@ -1526,6 +1526,17 @@
 }
 
 
+int
+xtensa_state_is_shared_or (xtensa_isa isa, xtensa_state st)
+{
+  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
+  CHECK_STATE (intisa, st, XTENSA_UNDEFINED);
+  if ((intisa->states[st].flags & XTENSA_STATE_IS_SHARED_OR) != 0)
+    return 1;
+  return 0;
+}
+
+
 
 /* Sysregs.  */
 
Index: gas/config/tc-xtensa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v
retrieving revision 1.106
diff -u -r1.106 tc-xtensa.c
--- gas/config/tc-xtensa.c	5 Nov 2008 00:45:04 -0000	1.106
+++ gas/config/tc-xtensa.c	19 Nov 2008 22:25:30 -0000
@@ -6539,7 +6539,7 @@
 	{
 	  xtensa_state t1_so = xtensa_stateOperand_state (isa, t1->opcode, i);
 	  t1_inout = xtensa_stateOperand_inout (isa, t1->opcode, i);
-	  if (t1_so != t2_so)
+	  if (t1_so != t2_so || xtensa_state_is_shared_or (isa, t1_so) == 1)
 	    continue;
 
 	  if (t2_inout == 'i' && (t1_inout == 'm' || t1_inout == 'o'))
Index: include/xtensa-isa-internal.h
===================================================================
RCS file: /cvs/src/src/include/xtensa-isa-internal.h,v
retrieving revision 1.6
diff -u -r1.6 xtensa-isa-internal.h
--- include/xtensa-isa-internal.h	10 May 2005 10:21:08 -0000	1.6
+++ include/xtensa-isa-internal.h	19 Nov 2008 22:25:38 -0000
@@ -1,5 +1,5 @@
 /* Internal definitions for configurable Xtensa ISA support.
-   Copyright 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -15,7 +15,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301,
+   USA.  */
 
 #ifndef XTENSA_ISA_INTERNAL_H
 #define XTENSA_ISA_INTERNAL_H
@@ -33,6 +34,7 @@
 #define XTENSA_OPCODE_IS_CALL		0x00000008
 
 #define XTENSA_STATE_IS_EXPORTED	0x00000001
+#define XTENSA_STATE_IS_SHARED_OR	0x00000002
 
 #define XTENSA_INTERFACE_HAS_SIDE_EFFECT 0x00000001
 
Index: include/xtensa-isa.h
===================================================================
RCS file: /cvs/src/src/include/xtensa-isa.h,v
retrieving revision 1.7
diff -u -r1.7 xtensa-isa.h
--- include/xtensa-isa.h	27 Nov 2006 19:23:21 -0000	1.7
+++ include/xtensa-isa.h	19 Nov 2008 22:25:38 -0000
@@ -1,5 +1,5 @@
 /* Interface definition for configurable Xtensa ISA support.
-   Copyright 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -15,7 +15,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, 
+   USA.  */
 
 #ifndef XTENSA_LIBISA_H
 #define XTENSA_LIBISA_H
@@ -686,6 +687,13 @@
 xtensa_state_is_exported (xtensa_isa isa, xtensa_state st);
 
 
+/* Check for a "shared_or" state.  Returns 0 if the condition is false,
+   1 if the condition is true, and XTENSA_UNDEFINED on error.  */
+
+extern int
+xtensa_state_is_shared_or (xtensa_isa isa, xtensa_state st);
+
+
 
 /* Sysregs ("special registers" and "user registers").  */
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]