gas: support for the sparc %ncc condition codes register.
authorJose E. Marchesi <jose.marchesi@oracle.com>
Fri, 1 May 2015 00:17:20 +0000 (17:17 -0700)
committerJose E. Marchesi <jose.marchesi@oracle.com>
Wed, 6 May 2015 16:26:23 +0000 (09:26 -0700)
gas/ChangeLog:

2015-05-06  Jose E. Marchesi  <jose.marchesi@oracle.com>

* config/tc-sparc.c (sparc_ip): Support the %ncc "natural"
condition codes
* doc/c-sparc.texi (Sparc-Regs): Document %ncc.

gas/testsuite/ChangeLog:

2015-05-06  Jose E. Marchesi  <jose.marchesi@oracle.com>

* gas/sparc/natural.s: New file.
* gas/sparc/natural-32.s: Likewise.
* gas/sparc/natural.d: Likewise.
* gas/sparc/natural-32.d: Likewise.
* gas/sparc/sparc.exp (sparc_elf_setup): Run the tests natural and
natural-32.

gas/ChangeLog
gas/config/tc-sparc.c
gas/doc/c-sparc.texi
gas/testsuite/ChangeLog
gas/testsuite/gas/sparc/natural-32.d [new file with mode: 0644]
gas/testsuite/gas/sparc/natural-32.s [new file with mode: 0644]
gas/testsuite/gas/sparc/natural.d [new file with mode: 0644]
gas/testsuite/gas/sparc/natural.s [new file with mode: 0644]
gas/testsuite/gas/sparc/sparc.exp

index 09589a65db3e5708957ce58784b67720439e7d71..57b3bf54e5d12f028adca5af00aa3390ce357e42 100644 (file)
@@ -1,3 +1,9 @@
+2015-05-06  Jose E. Marchesi  <jose.marchesi@oracle.com>
+
+       * config/tc-sparc.c (sparc_ip): Support the %ncc "natural"
+       condition codes
+       * doc/c-sparc.texi (Sparc-Regs): Document %ncc.
+
 2015-05-06  Nick Clifton  <nickc@redhat.com>
 
        * doc/as.texinfo (Dollar Local Labels): Note that these are only
index 60bdcc6bfae2ed7c01512e61eea48b18c314b132..3ffe74f721902c8ab8b5ba3def8ffe1d6b330358 100644 (file)
@@ -1973,7 +1973,8 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn)
                {
                  ++s;
                }
-             if (strncmp (s, "%icc", 4) == 0)
+             if ((strncmp (s, "%icc", 4) == 0)
+                  || (sparc_arch_size == 32 && strncmp (s, "%ncc", 4) == 0))
                {
                  s += 4;
                  continue;
@@ -1985,7 +1986,8 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn)
                {
                  ++s;
                }
-             if (strncmp (s, "%xcc", 4) == 0)
+              if ((strncmp (s, "%xcc", 4) == 0)
+                  || (sparc_arch_size == 64 && strncmp (s, "%ncc", 4) == 0))
                {
                  s += 4;
                  continue;
index aedf25c434480190f149436d8888e8256b23db03..f482e3a6b6fb510ebb34d76682c60f7532d388af 100644 (file)
@@ -303,6 +303,10 @@ Various V9 branch and conditional move instructions allow
 specification of which set of integer condition codes to
 test.  These are referred to as @samp{%xcc} and @samp{%icc}.
 
+Additionally, GAS supports the so-called ``natural'' condition codes;
+these are referred to as @samp{%ncc} and reference to @samp{%icc} if
+the word size is 32, @samp{%xcc} if the word size is 64.
+
 In V9, there are 4 sets of floating point condition codes
 which are referred to as @samp{%fcc@var{n}}.
 
index 41604ef675c1d8ae6756848598e4dcfda3df038e..347fbb2407a7b3020664bea1cdea82a79c84cab2 100644 (file)
@@ -1,3 +1,13 @@
+2015-05-06  Jose E. Marchesi  <jose.marchesi@oracle.com>
+
+
+       * gas/sparc/natural.s: New file.
+       * gas/sparc/natural-32.s: Likewise.
+       * gas/sparc/natural.d: Likewise.
+       * gas/sparc/natural-32.d: Likewise.
+       * gas/sparc/sparc.exp (sparc_elf_setup): Run the tests natural and
+       natural-32.
+
 2015-05-06  Renlin Li  <renlin.li@arm.com>
 
        * gas/aarch64/codealign_1.s: New.
diff --git a/gas/testsuite/gas/sparc/natural-32.d b/gas/testsuite/gas/sparc/natural-32.d
new file mode 100644 (file)
index 0000000..039e45e
--- /dev/null
@@ -0,0 +1,10 @@
+#as: -Av9 -32
+#objdump: -dr --prefix-addresses
+#name: sparc natural regs and insns
+
+.*: +file format .*
+
+Disassembly of section .text:
+0x00000000 b  %icc, 0x00000008
+0x0+0000004 nop 
+0x0+0000008 nop 
diff --git a/gas/testsuite/gas/sparc/natural-32.s b/gas/testsuite/gas/sparc/natural-32.s
new file mode 100644 (file)
index 0000000..2a51441
--- /dev/null
@@ -0,0 +1,5 @@
+# Test SPARC "natural" registers and instructions
+        .text
+        ba %ncc, 0f
+         nop
+0:      nop
diff --git a/gas/testsuite/gas/sparc/natural.d b/gas/testsuite/gas/sparc/natural.d
new file mode 100644 (file)
index 0000000..e29c251
--- /dev/null
@@ -0,0 +1,10 @@
+#as: -Av9 -64
+#objdump: -dr --prefix-addresses
+#name: sparc natural regs and insns
+
+.*: +file format .*
+
+Disassembly of section .text:
+0x0+0000000 b  %xcc, 0x0+0000008
+0x0+0000004 nop 
+0x0+0000008 nop 
diff --git a/gas/testsuite/gas/sparc/natural.s b/gas/testsuite/gas/sparc/natural.s
new file mode 100644 (file)
index 0000000..2a51441
--- /dev/null
@@ -0,0 +1,5 @@
+# Test SPARC "natural" registers and instructions
+        .text
+        ba %ncc, 0f
+         nop
+0:      nop
index 36113f625a3a132b98884d4e927a654d03b49b98..874f795cd8106802f6be3e3a08d0af2bdef92ac5 100644 (file)
@@ -93,6 +93,8 @@ if [istarget sparc*-*-*] {
     run_dump_test "mwait"
     run_dump_test "mcdper"
     run_dump_test "sparc5vis4"
+    run_dump_test "natural"
+    run_dump_test "natural-32"
 
     run_list_test "pr4587" ""
 }