public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* C6X gas: Remove "-matomic" option
@ 2011-02-03 21:11 Bernd Schmidt
  2011-02-03 22:44 ` Joseph S. Myers
  0 siblings, 1 reply; 4+ messages in thread
From: Bernd Schmidt @ 2011-02-03 21:11 UTC (permalink / raw)
  To: binutils; +Cc: Joseph S. Myers

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

TI has decided that for convenience they'd prefer if -march=c64x+ simply
enabled atomic instructions, even if they are not usable on all devices.
The following patch implements this. Ok?


Bernd

[-- Attachment #2: noatomic2.diff --]
[-- Type: text/plain, Size: 11920 bytes --]

	gas/
	* doc/as.texinfo (Target TIC6X options): Don't mention "-matomic".
	* doc/c-tic6x.texi (TIC6X Directives): Don't mention ".atomic".
	(TIC6X Options): Don't mention "-matomic".
	* config/tc-tic6x.c (OPTION_MATOMIC, OPTION_MNO_ATOMIC): Delete.
	(md_longopts): Remove corresponding entries.
	(md_parse_option): Don't handle them.
	(md_show_usage): Don't document them.
	(tic6x_atomic): Delete variable.
	(tic6x_update_features): Always copy tic6x_arch_enable to
	tic6x_features.
	(tic6x_arch_enable): Add TIC6X_INSN_ATOMIC to C64x+ and C674x entries.
	(s_tic6x_atomic, s_tic6x_noatomic): Remove functions.
	(md_pseudo_table): Remove ".atomic" and ".noatomic".

	gas/testsuite/
	* gas/tic6x/dir-junk.l: Remove tests for .atomic and .noatomic.
	* gas/tic6x/dir-junk.s: Likewise.
	* gas/tic6x/insns-c674x-bad.d: Remove test.
	* gas/tic6x/insns-c674x-bad.l: Likewise.
	* gas/tic6x/insns-atomic.d: Remove "-matomic" switch.
	
Index: gas/doc/as.texinfo
===================================================================
--- gas/doc/as.texinfo	(revision 307279)
+++ gas/doc/as.texinfo	(working copy)
@@ -477,9 +477,9 @@ gcc(1), ld(1), and the Info entries for 
 @ifset TIC6X
 
 @emph{Target TIC6X options:}
-   [@b{-march=@var{arch}}] [@b{-matomic}|@b{-mno-atomic}]
-   [@b{-mbig-endian}|@b{-mlittle-endian}] [@b{-mdsbt}|@b{-mno-dsbt}]
-   [@b{-mpid=no}|@b{-mpid=near}|@b{-mpid=far}] [@b{-mpic}|@b{-mno-pic}]
+   [@b{-march=@var{arch}}] [@b{-mbig-endian}|@b{-mlittle-endian}]
+   [@b{-mdsbt}|@b{-mno-dsbt}] [@b{-mpid=no}|@b{-mpid=near}|@b{-mpid=far}]
+   [@b{-mpic}|@b{-mno-pic}]
 @end ifset
 
 @ifset Z80
@@ -1281,18 +1281,6 @@ all instructions are permitted.
 The following values of @var{arch} are accepted: @code{c62x},
 @code{c64x}, @code{c64x+}, @code{c67x}, @code{c67x+}, @code{c674x}.
 
-@item -matomic
-@itemx -mno-atomic
-Enable or disable the optional C64x+ atomic operation instructions.
-By default, they are enabled if no @option{-march} option is given, or
-if an architecture is specified with @option{-march} that implies
-these instructions are present (currently, there are no such
-architectures); they are disabled if an architecture is specified with
-@option{-march} on which the instructions are optional or not
-present.  This option overrides such a default from the architecture,
-independent of the order in which the @option{-march} or
-@option{-matomic} or @option{-mno-atomic} options are passed.
-
 @item -mdsbt
 @itemx -mno-dsbt
 The @option{-mdsbt} option causes the assembler to generate the
Index: gas/doc/c-tic6x.texi
===================================================================
--- gas/doc/c-tic6x.texi	(revision 307288)
+++ gas/doc/c-tic6x.texi	(working copy)
@@ -34,20 +34,6 @@ all instructions are permitted.
 The following values of @var{arch} are accepted: @code{c62x},
 @code{c64x}, @code{c64x+}, @code{c67x}, @code{c67x+}, @code{c674x}.
 
-@cindex @code{-matomic} command line option, TIC6X
-@cindex @code{-mno-atomic} command line option, TIC6X
-@item -matomic
-@itemx -mno-atomic
-Enable or disable the optional C64x+ atomic operation instructions.
-By default, they are enabled if no @option{-march} option is given, or
-if an architecture is specified with @option{-march} that implies
-these instructions are present (currently, there are no such
-architectures); they are disabled if an architecture is specified with
-@option{-march} on which the instructions are optional or not
-present.  This option overrides such a default from the architecture,
-independent of the order in which the @option{-march} or
-@option{-matomic} or @option{-mno-atomic} options are passed.
-
 @cindex @code{-mdsbt} command line option, TIC6X
 @cindex @code{-mno-dsbt} command line option, TIC6X
 @item -mdsbt
@@ -139,13 +125,6 @@ subsequent directive overriding it.
 @item .arch @var{arch}
 This has the same effect as @option{-march=@var{arch}}.
 
-@cindex @code{.atomic} directive, TIC6X
-@cindex @code{.noatomic} directive, TIC6X
-@item .atomic
-@itemx .noatomic
-These have the same effects as @option{-matomic} and
-@option{-mno-atomic}.
-
 @cindex @code{.c6xabi_attribute} directive, TIC6X
 @item .c6xabi_attribute @var{tag}, @var{value}
 Set the C6000 EABI build attribute @var{tag} to @var{value}.
Index: gas/testsuite/gas/tic6x/dir-junk.l
===================================================================
--- gas/testsuite/gas/tic6x/dir-junk.l	(revision 307279)
+++ gas/testsuite/gas/tic6x/dir-junk.l	(working copy)
@@ -1,5 +1,3 @@
 [^:]*: Assembler messages:
 [^:]*:2: Error: junk at end of line, first unrecognized character is `c'
-[^:]*:3: Error: junk at end of line, first unrecognized character is `f'
-[^:]*:6: Error: junk at end of line, first unrecognized character is `b'
-[^:]*:7: Error: junk at end of line, first unrecognized character is `x'
+[^:]*:3: Error: junk at end of line, first unrecognized character is `x'
Index: gas/testsuite/gas/tic6x/dir-junk.s
===================================================================
--- gas/testsuite/gas/tic6x/dir-junk.s	(revision 307279)
+++ gas/testsuite/gas/tic6x/dir-junk.s	(working copy)
@@ -1,7 +1,3 @@
 .arch c64x 
 .arch c64x c64x
-.atomic foo
-.atomic ; comment OK
-.noatomic
-.noatomic bar
 .nocmp x
Index: gas/testsuite/gas/tic6x/insns-c674x-bad.d
===================================================================
--- gas/testsuite/gas/tic6x/insns-c674x-bad.d	(revision 307279)
+++ gas/testsuite/gas/tic6x/insns-c674x-bad.d	(working copy)
@@ -1,3 +0,0 @@
-#name: C674x bad instructions
-#as: -march=c674x
-#error-output: insns-c674x-bad.l
Index: gas/testsuite/gas/tic6x/insns-c674x-bad.l
===================================================================
--- gas/testsuite/gas/tic6x/insns-c674x-bad.l	(revision 307279)
+++ gas/testsuite/gas/tic6x/insns-c674x-bad.l	(working copy)
@@ -1,7 +0,0 @@
-[^:]*: Assembler messages:
-[^:]*:6: Error: 'cmtl' instruction not supported on this architecture
-[^:]*:7: Error: 'll' instruction not supported on this architecture
-[^:]*:8: Error: 'sl' instruction not supported on this architecture
-[^:]*:14: Error: 'cmtl' instruction not supported on this architecture
-[^:]*:15: Error: 'll' instruction not supported on this architecture
-[^:]*:16: Error: 'sl' instruction not supported on this architecture
Index: gas/testsuite/gas/tic6x/insns-atomic.d
===================================================================
--- gas/testsuite/gas/tic6x/insns-atomic.d	(revision 307279)
+++ gas/testsuite/gas/tic6x/insns-atomic.d	(working copy)
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: C6X atomic instructions
-#as: -march=c674x -matomic -mlittle-endian
+#as: -march=c674x -mlittle-endian
 
 .*: *file format elf32-tic6x-le
 
Index: gas/testsuite/gas/tic6x/insns-c674x-bad.s
===================================================================
--- gas/testsuite/gas/tic6x/insns-c674x-bad.s	(revision 307279)
+++ gas/testsuite/gas/tic6x/insns-c674x-bad.s	(working copy)
@@ -1,16 +0,0 @@
-# Test instructions not present on C674x.
-.text
-.nocmp
-.globl f
-f:
-	cmtl .D2T2 *b0,b1
-	ll .D2T2 *b0,b1
-	sl .D2T2 b0,*b1
-.atomic
-	cmtl .D2T2 *b0,b1
-	ll .D2T2 *b0,b1
-	sl .D2T2 b0,*b1
-.noatomic
-	cmtl .D2T2 *b0,b1
-	ll .D2T2 *b0,b1
-	sl .D2T2 b0,*b1
Index: gas/config/tc-tic6x.c
===================================================================
--- gas/config/tc-tic6x.c	(revision 307288)
+++ gas/config/tc-tic6x.c	(working copy)
@@ -51,8 +51,6 @@ const char *md_shortopts = "";
 enum
   {
     OPTION_MARCH = OPTION_MD_BASE,
-    OPTION_MATOMIC,
-    OPTION_MNO_ATOMIC,
     OPTION_MBIG_ENDIAN,
     OPTION_MLITTLE_ENDIAN,
     OPTION_MDSBT,
@@ -66,8 +64,6 @@ enum
 struct option md_longopts[] =
   {
     { "march", required_argument, NULL, OPTION_MARCH },
-    { "matomic", no_argument, NULL, OPTION_MATOMIC },
-    { "mno-atomic", no_argument, NULL, OPTION_MNO_ATOMIC },
     { "mbig-endian", no_argument, NULL, OPTION_MBIG_ENDIAN },
     { "mlittle-endian", no_argument, NULL, OPTION_MLITTLE_ENDIAN },
     { "mdsbt", no_argument, NULL, OPTION_MDSBT },
@@ -80,13 +76,8 @@ struct option md_longopts[] =
   };
 size_t md_longopts_size = sizeof (md_longopts);
 
-/* Whether to enable atomic instructions.  1 to enable them, 0 to
-   disable, -1 to default from architecture.  */
-static int tic6x_atomic = -1;
-
 /* The instructions enabled based only on the selected architecture
-   (all instructions, if no architecture specified).  Atomic
-   instructions may be enabled or disabled separately.  */
+   (all instructions, if no architecture specified).  */
 static unsigned short tic6x_arch_enable = (TIC6X_INSN_C62X
 					   | TIC6X_INSN_C64X
 					   | TIC6X_INSN_C64XP
@@ -159,7 +150,8 @@ static const tic6x_arch_table tic6x_arch
     { "c64x", C6XABI_Tag_ISA_C64X, TIC6X_INSN_C62X | TIC6X_INSN_C64X },
     { "c64x+", C6XABI_Tag_ISA_C64XP, (TIC6X_INSN_C62X
 				      | TIC6X_INSN_C64X
-				      | TIC6X_INSN_C64XP) },
+				      | TIC6X_INSN_C64XP
+				      | TIC6X_INSN_ATOMIC) },
     { "c67x", C6XABI_Tag_ISA_C67X, TIC6X_INSN_C62X | TIC6X_INSN_C67X },
     { "c67x+", C6XABI_Tag_ISA_C67XP, (TIC6X_INSN_C62X
 				      | TIC6X_INSN_C67X
@@ -169,7 +161,8 @@ static const tic6x_arch_table tic6x_arch
 				      | TIC6X_INSN_C64XP
 				      | TIC6X_INSN_C67X
 				      | TIC6X_INSN_C67XP
-				      | TIC6X_INSN_C674X) }
+				      | TIC6X_INSN_C674X
+				      | TIC6X_INSN_ATOMIC) }
   };
 
 /* Update the selected architecture based on ARCH, giving an error if
@@ -238,14 +231,6 @@ md_parse_option (int c, char *arg)
       tic6x_use_arch (arg);
       break;
 
-    case OPTION_MATOMIC:
-      tic6x_atomic = 1;
-      break;
-
-    case OPTION_MNO_ATOMIC:
-      tic6x_atomic = 0;
-      break;
-
     case OPTION_MBIG_ENDIAN:
       target_big_endian = 1;
       break;
@@ -292,8 +277,6 @@ md_show_usage (FILE *stream ATTRIBUTE_UN
   fputc ('\n', stream);
   fprintf (stream, _("TMS320C6000 options:\n"));
   fprintf (stream, _("  -march=ARCH             enable instructions from architecture ARCH\n"));
-  fprintf (stream, _("  -matomic                enable atomic operation instructions\n"));
-  fprintf (stream, _("  -mno-atomic             disable atomic operation instructions\n"));
   fprintf (stream, _("  -mbig-endian            generate big-endian code\n"));
   fprintf (stream, _("  -mlittle-endian         generate little-endian code\n"));
   fprintf (stream, _("  -mdsbt                  code uses DSBT addressing\n"));
@@ -320,23 +303,7 @@ md_show_usage (FILE *stream ATTRIBUTE_UN
 static void
 tic6x_update_features (void)
 {
-  switch (tic6x_atomic)
-    {
-    case -1:
-      tic6x_features = tic6x_arch_enable;
-      break;
-
-    case 0:
-      tic6x_features = tic6x_arch_enable & ~TIC6X_INSN_ATOMIC;
-      break;
-
-    case 1:
-      tic6x_features = tic6x_arch_enable | TIC6X_INSN_ATOMIC;
-      break;
-
-    default:
-      abort ();
-    }
+  tic6x_features = tic6x_arch_enable;
 
   tic6x_num_registers
     = (tic6x_arch_enable & (TIC6X_INSN_C64X | TIC6X_INSN_C67XP)) ? 32 : 16;
@@ -381,26 +348,6 @@ s_tic6x_arch (int ignored ATTRIBUTE_UNUS
   demand_empty_rest_of_line ();
 }
 
-/* Parse a .atomic directive.  */
-
-static void
-s_tic6x_atomic (int ignored ATTRIBUTE_UNUSED)
-{
-  tic6x_atomic = 1;
-  tic6x_update_features ();
-  demand_empty_rest_of_line ();
-}
-
-/* Parse a .noatomic directive.  */
-
-static void
-s_tic6x_noatomic (int ignored ATTRIBUTE_UNUSED)
-{
-  tic6x_atomic = 0;
-  tic6x_update_features ();
-  demand_empty_rest_of_line ();
-}
-
 /* Parse a .nocmp directive.  */
 
 static void
@@ -587,9 +534,7 @@ tic6x_convert_symbolic_attribute (const 
 const pseudo_typeS md_pseudo_table[] =
   {
     { "arch", s_tic6x_arch, 0 },
-    { "atomic", s_tic6x_atomic, 0 },
     { "c6xabi_attribute", s_tic6x_c6xabi_attribute, 0 },
-    { "noatomic", s_tic6x_noatomic, 0 },
     { "nocmp", s_tic6x_nocmp, 0 },
     { "scomm",	s_tic6x_scomm, 0 },
     { "word", cons, 4 },

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

* Re: C6X gas: Remove "-matomic" option
  2011-02-03 21:11 C6X gas: Remove "-matomic" option Bernd Schmidt
@ 2011-02-03 22:44 ` Joseph S. Myers
  2011-02-03 22:51   ` Bernd Schmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Joseph S. Myers @ 2011-02-03 22:44 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: binutils

On Thu, 3 Feb 2011, Bernd Schmidt wrote:

> TI has decided that for convenience they'd prefer if -march=c64x+ simply
> enabled atomic instructions, even if they are not usable on all devices.
> The following patch implements this. Ok?

It seems to me that if you treat these instructions as present on all 
C64x+ and C674x then you should no longer need TIC6X_INSN_ATOMIC at all; 
the instructions in question should just be marked as TIC6X_INSN_C64XP 
instead.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: C6X gas: Remove "-matomic" option
  2011-02-03 22:44 ` Joseph S. Myers
@ 2011-02-03 22:51   ` Bernd Schmidt
  2011-02-03 22:58     ` Joseph S. Myers
  0 siblings, 1 reply; 4+ messages in thread
From: Bernd Schmidt @ 2011-02-03 22:51 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: binutils

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

On 02/03/2011 11:44 PM, Joseph S. Myers wrote:
> On Thu, 3 Feb 2011, Bernd Schmidt wrote:
> 
>> TI has decided that for convenience they'd prefer if -march=c64x+ simply
>> enabled atomic instructions, even if they are not usable on all devices.
>> The following patch implements this. Ok?
> 
> It seems to me that if you treat these instructions as present on all 
> C64x+ and C674x then you should no longer need TIC6X_INSN_ATOMIC at all; 
> the instructions in question should just be marked as TIC6X_INSN_C64XP 
> instead.

Like this?


Bernd


[-- Attachment #2: noatomic3.diff --]
[-- Type: text/plain, Size: 13401 bytes --]

	gas/
	* doc/as.texinfo (Target TIC6X options): Don't mention "-matomic".
	* doc/c-tic6x.texi (TIC6X Directives): Don't mention ".atomic".
	(TIC6X Options): Don't mention "-matomic".
	* config/tc-tic6x.c (OPTION_MATOMIC, OPTION_MNO_ATOMIC): Delete.
	(md_longopts): Remove corresponding entries.
	(md_parse_option): Don't handle them.
	(md_show_usage): Don't document them.
	(tic6x_atomic): Delete variable.
	(tic6x_update_features): Always copy tic6x_arch_enable to
	tic6x_features.
	(tic6x_arch_enable): Remove references to TIC6X_INSN_ATOMIC.
	(s_tic6x_atomic, s_tic6x_noatomic): Remove functions.
	(md_pseudo_table): Remove ".atomic" and ".noatomic".

	gas/testsuite/
	* gas/tic6x/dir-junk.l: Remove tests for .atomic and .noatomic.
	* gas/tic6x/dir-junk.s: Likewise.
	* gas/tic6x/insns-c674x-bad.d: Remove test.
	* gas/tic6x/insns-c674x-bad.l: Likewise.
	* gas/tic6x/insns-atomic.d: Remove "-matomic" switch.

	include/opcode/
	* tic6x-opcode-table.h (cmtl, ll, sl): Available on C64XP.
	* tic6x.h (TIC6X_INSN_ATOMIC): Remove.

Index: gas/doc/as.texinfo
===================================================================
--- gas/doc/as.texinfo	(revision 307279)
+++ gas/doc/as.texinfo	(working copy)
@@ -477,9 +477,9 @@ gcc(1), ld(1), and the Info entries for 
 @ifset TIC6X
 
 @emph{Target TIC6X options:}
-   [@b{-march=@var{arch}}] [@b{-matomic}|@b{-mno-atomic}]
-   [@b{-mbig-endian}|@b{-mlittle-endian}] [@b{-mdsbt}|@b{-mno-dsbt}]
-   [@b{-mpid=no}|@b{-mpid=near}|@b{-mpid=far}] [@b{-mpic}|@b{-mno-pic}]
+   [@b{-march=@var{arch}}] [@b{-mbig-endian}|@b{-mlittle-endian}]
+   [@b{-mdsbt}|@b{-mno-dsbt}] [@b{-mpid=no}|@b{-mpid=near}|@b{-mpid=far}]
+   [@b{-mpic}|@b{-mno-pic}]
 @end ifset
 
 @ifset Z80
@@ -1281,18 +1281,6 @@ all instructions are permitted.
 The following values of @var{arch} are accepted: @code{c62x},
 @code{c64x}, @code{c64x+}, @code{c67x}, @code{c67x+}, @code{c674x}.
 
-@item -matomic
-@itemx -mno-atomic
-Enable or disable the optional C64x+ atomic operation instructions.
-By default, they are enabled if no @option{-march} option is given, or
-if an architecture is specified with @option{-march} that implies
-these instructions are present (currently, there are no such
-architectures); they are disabled if an architecture is specified with
-@option{-march} on which the instructions are optional or not
-present.  This option overrides such a default from the architecture,
-independent of the order in which the @option{-march} or
-@option{-matomic} or @option{-mno-atomic} options are passed.
-
 @item -mdsbt
 @itemx -mno-dsbt
 The @option{-mdsbt} option causes the assembler to generate the
Index: gas/doc/c-tic6x.texi
===================================================================
--- gas/doc/c-tic6x.texi	(revision 307288)
+++ gas/doc/c-tic6x.texi	(working copy)
@@ -34,20 +34,6 @@ all instructions are permitted.
 The following values of @var{arch} are accepted: @code{c62x},
 @code{c64x}, @code{c64x+}, @code{c67x}, @code{c67x+}, @code{c674x}.
 
-@cindex @code{-matomic} command line option, TIC6X
-@cindex @code{-mno-atomic} command line option, TIC6X
-@item -matomic
-@itemx -mno-atomic
-Enable or disable the optional C64x+ atomic operation instructions.
-By default, they are enabled if no @option{-march} option is given, or
-if an architecture is specified with @option{-march} that implies
-these instructions are present (currently, there are no such
-architectures); they are disabled if an architecture is specified with
-@option{-march} on which the instructions are optional or not
-present.  This option overrides such a default from the architecture,
-independent of the order in which the @option{-march} or
-@option{-matomic} or @option{-mno-atomic} options are passed.
-
 @cindex @code{-mdsbt} command line option, TIC6X
 @cindex @code{-mno-dsbt} command line option, TIC6X
 @item -mdsbt
@@ -139,13 +125,6 @@ subsequent directive overriding it.
 @item .arch @var{arch}
 This has the same effect as @option{-march=@var{arch}}.
 
-@cindex @code{.atomic} directive, TIC6X
-@cindex @code{.noatomic} directive, TIC6X
-@item .atomic
-@itemx .noatomic
-These have the same effects as @option{-matomic} and
-@option{-mno-atomic}.
-
 @cindex @code{.c6xabi_attribute} directive, TIC6X
 @item .c6xabi_attribute @var{tag}, @var{value}
 Set the C6000 EABI build attribute @var{tag} to @var{value}.
Index: gas/testsuite/gas/tic6x/dir-junk.l
===================================================================
--- gas/testsuite/gas/tic6x/dir-junk.l	(revision 307279)
+++ gas/testsuite/gas/tic6x/dir-junk.l	(working copy)
@@ -1,5 +1,3 @@
 [^:]*: Assembler messages:
 [^:]*:2: Error: junk at end of line, first unrecognized character is `c'
-[^:]*:3: Error: junk at end of line, first unrecognized character is `f'
-[^:]*:6: Error: junk at end of line, first unrecognized character is `b'
-[^:]*:7: Error: junk at end of line, first unrecognized character is `x'
+[^:]*:3: Error: junk at end of line, first unrecognized character is `x'
Index: gas/testsuite/gas/tic6x/dir-junk.s
===================================================================
--- gas/testsuite/gas/tic6x/dir-junk.s	(revision 307279)
+++ gas/testsuite/gas/tic6x/dir-junk.s	(working copy)
@@ -1,7 +1,3 @@
 .arch c64x 
 .arch c64x c64x
-.atomic foo
-.atomic ; comment OK
-.noatomic
-.noatomic bar
 .nocmp x
Index: gas/testsuite/gas/tic6x/insns-c674x-bad.d
===================================================================
--- gas/testsuite/gas/tic6x/insns-c674x-bad.d	(revision 307279)
+++ gas/testsuite/gas/tic6x/insns-c674x-bad.d	(working copy)
@@ -1,3 +0,0 @@
-#name: C674x bad instructions
-#as: -march=c674x
-#error-output: insns-c674x-bad.l
Index: gas/testsuite/gas/tic6x/insns-c674x-bad.l
===================================================================
--- gas/testsuite/gas/tic6x/insns-c674x-bad.l	(revision 307279)
+++ gas/testsuite/gas/tic6x/insns-c674x-bad.l	(working copy)
@@ -1,7 +0,0 @@
-[^:]*: Assembler messages:
-[^:]*:6: Error: 'cmtl' instruction not supported on this architecture
-[^:]*:7: Error: 'll' instruction not supported on this architecture
-[^:]*:8: Error: 'sl' instruction not supported on this architecture
-[^:]*:14: Error: 'cmtl' instruction not supported on this architecture
-[^:]*:15: Error: 'll' instruction not supported on this architecture
-[^:]*:16: Error: 'sl' instruction not supported on this architecture
Index: gas/testsuite/gas/tic6x/insns-atomic.d
===================================================================
--- gas/testsuite/gas/tic6x/insns-atomic.d	(revision 307279)
+++ gas/testsuite/gas/tic6x/insns-atomic.d	(working copy)
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: C6X atomic instructions
-#as: -march=c674x -matomic -mlittle-endian
+#as: -march=c674x -mlittle-endian
 
 .*: *file format elf32-tic6x-le
 
Index: gas/testsuite/gas/tic6x/insns-c674x-bad.s
===================================================================
--- gas/testsuite/gas/tic6x/insns-c674x-bad.s	(revision 307279)
+++ gas/testsuite/gas/tic6x/insns-c674x-bad.s	(working copy)
@@ -1,16 +0,0 @@
-# Test instructions not present on C674x.
-.text
-.nocmp
-.globl f
-f:
-	cmtl .D2T2 *b0,b1
-	ll .D2T2 *b0,b1
-	sl .D2T2 b0,*b1
-.atomic
-	cmtl .D2T2 *b0,b1
-	ll .D2T2 *b0,b1
-	sl .D2T2 b0,*b1
-.noatomic
-	cmtl .D2T2 *b0,b1
-	ll .D2T2 *b0,b1
-	sl .D2T2 b0,*b1
Index: gas/config/tc-tic6x.c
===================================================================
--- gas/config/tc-tic6x.c	(revision 307288)
+++ gas/config/tc-tic6x.c	(working copy)
@@ -51,8 +51,6 @@ const char *md_shortopts = "";
 enum
   {
     OPTION_MARCH = OPTION_MD_BASE,
-    OPTION_MATOMIC,
-    OPTION_MNO_ATOMIC,
     OPTION_MBIG_ENDIAN,
     OPTION_MLITTLE_ENDIAN,
     OPTION_MDSBT,
@@ -66,8 +64,6 @@ enum
 struct option md_longopts[] =
   {
     { "march", required_argument, NULL, OPTION_MARCH },
-    { "matomic", no_argument, NULL, OPTION_MATOMIC },
-    { "mno-atomic", no_argument, NULL, OPTION_MNO_ATOMIC },
     { "mbig-endian", no_argument, NULL, OPTION_MBIG_ENDIAN },
     { "mlittle-endian", no_argument, NULL, OPTION_MLITTLE_ENDIAN },
     { "mdsbt", no_argument, NULL, OPTION_MDSBT },
@@ -80,20 +76,14 @@ struct option md_longopts[] =
   };
 size_t md_longopts_size = sizeof (md_longopts);
 
-/* Whether to enable atomic instructions.  1 to enable them, 0 to
-   disable, -1 to default from architecture.  */
-static int tic6x_atomic = -1;
-
 /* The instructions enabled based only on the selected architecture
-   (all instructions, if no architecture specified).  Atomic
-   instructions may be enabled or disabled separately.  */
+   (all instructions, if no architecture specified).  */
 static unsigned short tic6x_arch_enable = (TIC6X_INSN_C62X
 					   | TIC6X_INSN_C64X
 					   | TIC6X_INSN_C64XP
 					   | TIC6X_INSN_C67X
 					   | TIC6X_INSN_C67XP
-					   | TIC6X_INSN_C674X
-					   | TIC6X_INSN_ATOMIC);
+					   | TIC6X_INSN_C674X);
 
 /* The instructions enabled based on the current set of features
    (architecture, as modified by other options).  */
@@ -238,14 +228,6 @@ md_parse_option (int c, char *arg)
       tic6x_use_arch (arg);
       break;
 
-    case OPTION_MATOMIC:
-      tic6x_atomic = 1;
-      break;
-
-    case OPTION_MNO_ATOMIC:
-      tic6x_atomic = 0;
-      break;
-
     case OPTION_MBIG_ENDIAN:
       target_big_endian = 1;
       break;
@@ -292,8 +274,6 @@ md_show_usage (FILE *stream ATTRIBUTE_UN
   fputc ('\n', stream);
   fprintf (stream, _("TMS320C6000 options:\n"));
   fprintf (stream, _("  -march=ARCH             enable instructions from architecture ARCH\n"));
-  fprintf (stream, _("  -matomic                enable atomic operation instructions\n"));
-  fprintf (stream, _("  -mno-atomic             disable atomic operation instructions\n"));
   fprintf (stream, _("  -mbig-endian            generate big-endian code\n"));
   fprintf (stream, _("  -mlittle-endian         generate little-endian code\n"));
   fprintf (stream, _("  -mdsbt                  code uses DSBT addressing\n"));
@@ -320,23 +300,7 @@ md_show_usage (FILE *stream ATTRIBUTE_UN
 static void
 tic6x_update_features (void)
 {
-  switch (tic6x_atomic)
-    {
-    case -1:
-      tic6x_features = tic6x_arch_enable;
-      break;
-
-    case 0:
-      tic6x_features = tic6x_arch_enable & ~TIC6X_INSN_ATOMIC;
-      break;
-
-    case 1:
-      tic6x_features = tic6x_arch_enable | TIC6X_INSN_ATOMIC;
-      break;
-
-    default:
-      abort ();
-    }
+  tic6x_features = tic6x_arch_enable;
 
   tic6x_num_registers
     = (tic6x_arch_enable & (TIC6X_INSN_C64X | TIC6X_INSN_C67XP)) ? 32 : 16;
@@ -381,26 +345,6 @@ s_tic6x_arch (int ignored ATTRIBUTE_UNUS
   demand_empty_rest_of_line ();
 }
 
-/* Parse a .atomic directive.  */
-
-static void
-s_tic6x_atomic (int ignored ATTRIBUTE_UNUSED)
-{
-  tic6x_atomic = 1;
-  tic6x_update_features ();
-  demand_empty_rest_of_line ();
-}
-
-/* Parse a .noatomic directive.  */
-
-static void
-s_tic6x_noatomic (int ignored ATTRIBUTE_UNUSED)
-{
-  tic6x_atomic = 0;
-  tic6x_update_features ();
-  demand_empty_rest_of_line ();
-}
-
 /* Parse a .nocmp directive.  */
 
 static void
@@ -587,9 +531,7 @@ tic6x_convert_symbolic_attribute (const 
 const pseudo_typeS md_pseudo_table[] =
   {
     { "arch", s_tic6x_arch, 0 },
-    { "atomic", s_tic6x_atomic, 0 },
     { "c6xabi_attribute", s_tic6x_c6xabi_attribute, 0 },
-    { "noatomic", s_tic6x_noatomic, 0 },
     { "nocmp", s_tic6x_nocmp, 0 },
     { "scomm",	s_tic6x_scomm, 0 },
     { "word", cons, 4 },
Index: include/opcode/tic6x-opcode-table.h
===================================================================
--- include/opcode/tic6x-opcode-table.h	(revision 307279)
+++ include/opcode/tic6x-opcode-table.h	(working copy)
@@ -791,7 +791,7 @@ INSN(cmpyr1, m, 1_or_2_src, 4cycle, C64X
      ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
 	  ENC(src2, reg, 1), ENC(dst, reg, 2)))
 
-INSN(cmtl, d, 1_or_2_src, load, ATOMIC,
+INSN(cmtl, d, 1_or_2_src, load, C64XP,
      TIC6X_FLAG_LOAD|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
      FIX3(FIX(s, 1), FIX(op, 0xe), FIX(src1, 0)),
      OP2(ORMEMDW, OWDREG5),
@@ -1089,7 +1089,7 @@ INSN(ldw, d, load_store_long, load, C62X
      ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_word, 0),
 	  ENC(dst, reg, 1)))
 
-INSN(ll, d, 1_or_2_src, load, ATOMIC,
+INSN(ll, d, 1_or_2_src, load, C64XP,
      TIC6X_FLAG_LOAD|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
      FIX3(FIX(s, 1), FIX(op, 0xc), FIX(src1, 0)),
      OP2(ORMEMDW, OWDREG5),
@@ -1894,7 +1894,7 @@ INSNE(shru2, s_xu2_u5_u2, s, 1_or_2_src,
       ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
 	   ENC(src1, ucst, 1), ENC(dst, reg, 2)))
 
-INSN(sl, d, 1_or_2_src, store, ATOMIC,
+INSN(sl, d, 1_or_2_src, store, C64XP,
      TIC6X_FLAG_STORE|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
      FIX3(FIX(s, 1), FIX(op, 0xd), FIX(src1, 0)),
      OP2(ORDREG1, OWMEMDW),
Index: include/opcode/tic6x.h
===================================================================
--- include/opcode/tic6x.h	(revision 307279)
+++ include/opcode/tic6x.h	(working copy)
@@ -132,7 +132,6 @@ typedef struct
 #define TIC6X_INSN_C67X		0x0008
 #define TIC6X_INSN_C67XP	0x0010
 #define TIC6X_INSN_C674X	0x0020
-#define TIC6X_INSN_ATOMIC	0x0040
 
 /* Flags with further information about an opcode table entry.  */
 

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

* Re: C6X gas: Remove "-matomic" option
  2011-02-03 22:51   ` Bernd Schmidt
@ 2011-02-03 22:58     ` Joseph S. Myers
  0 siblings, 0 replies; 4+ messages in thread
From: Joseph S. Myers @ 2011-02-03 22:58 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: binutils

On Thu, 3 Feb 2011, Bernd Schmidt wrote:

> On 02/03/2011 11:44 PM, Joseph S. Myers wrote:
> > On Thu, 3 Feb 2011, Bernd Schmidt wrote:
> > 
> >> TI has decided that for convenience they'd prefer if -march=c64x+ simply
> >> enabled atomic instructions, even if they are not usable on all devices.
> >> The following patch implements this. Ok?
> > 
> > It seems to me that if you treat these instructions as present on all 
> > C64x+ and C674x then you should no longer need TIC6X_INSN_ATOMIC at all; 
> > the instructions in question should just be marked as TIC6X_INSN_C64XP 
> > instead.
> 
> Like this?

Yes, this is OK, with copyright date updates and adjusted to current 
sources (as.texinfo no longer duplicates detailed descriptions of 
individual target options after 
<http://sourceware.org/ml/binutils/2010-11/msg00205.html>).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

end of thread, other threads:[~2011-02-03 22:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-03 21:11 C6X gas: Remove "-matomic" option Bernd Schmidt
2011-02-03 22:44 ` Joseph S. Myers
2011-02-03 22:51   ` Bernd Schmidt
2011-02-03 22:58     ` Joseph S. Myers

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).