public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATH 2/3] gas: added tests for the sparc natural instructions.
  2015-05-01 17:39 [PATH 0/3] [SPARC] Support for %ncc and tests for the "natural" insns Jose E. Marchesi
  2015-05-01 17:39 ` [PATH 3/3] gas: typo in comment fixed Jose E. Marchesi
@ 2015-05-01 17:39 ` Jose E. Marchesi
  2015-05-01 17:39 ` [PATH 1/3] gas: support for the sparc %ncc condition codes register Jose E. Marchesi
  2015-05-06 11:48 ` [PATH 0/3] [SPARC] Support for %ncc and tests for the "natural" insns Nicholas Clifton
  3 siblings, 0 replies; 6+ messages in thread
From: Jose E. Marchesi @ 2015-05-01 17:39 UTC (permalink / raw)
  To: binutils

gas/ChangeLog:

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

	* gas/sparc/natural-32.d: Test ldn, ldna, stn, stna, slln, srln,
	sran, casn, casna and clrn.
	* gas/sparc/natural-32.s: Likewise.
	* gas/sparc/natural.s: Likewise.
	* gas/sparc/natural.d: Likewise.
---
 gas/testsuite/ChangeLog              |  8 ++++++++
 gas/testsuite/gas/sparc/natural-32.d | 16 +++++++++++++---
 gas/testsuite/gas/sparc/natural-32.s | 10 ++++++++++
 gas/testsuite/gas/sparc/natural.d    | 14 ++++++++++++--
 gas/testsuite/gas/sparc/natural.s    | 10 ++++++++++
 5 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 75fc289..4349f75 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,13 @@
 2015-05-01  Jose E. Marchesi  <jose.marchesi@oracle.com>
 
+	* gas/sparc/natural-32.d: Test ldn, ldna, stn, stna, slln, srln,
+	sran, casn, casna and clrn.
+	* gas/sparc/natural-32.s: Likewise.
+	* gas/sparc/natural.s: Likewise.
+	* gas/sparc/natural.d: Likewise.
+
+2015-05-01  Jose E. Marchesi  <jose.marchesi@oracle.com>
+
 
 	* gas/sparc/natural.s: New file.
 	* gas/sparc/natural-32.s: Likewise.
diff --git a/gas/testsuite/gas/sparc/natural-32.d b/gas/testsuite/gas/sparc/natural-32.d
index 039e45e..1fb1384 100644
--- a/gas/testsuite/gas/sparc/natural-32.d
+++ b/gas/testsuite/gas/sparc/natural-32.d
@@ -5,6 +5,16 @@
 .*: +file format .*
 
 Disassembly of section .text:
-0x00000000 b  %icc, 0x00000008
-0x0+0000004 nop 
-0x0+0000008 nop 
+0x00000000 b  %icc, 0x00000030
+0x00000004 nop 
+0x00000008 ld  \[ %g1 \], %g2
+0x0000000c lda  \[ %g1 \] #ASI_AIUP, %g2
+0x00000010 st  %g1, \[ %g2 \]
+0x00000014 sta  %g1, \[ %g2 \] #ASI_AIUP
+0x00000018 sll  %g1, 0xa, %g2
+0x0000001c srl  %g1, 0xa, %g2
+0x00000020 sra  %g1, 0xa, %g2
+0x00000024 cas  \[ %g1 \], %g2, %g3
+0x00000028 casa  \[ %g1 \] #ASI_AIUP, %g2, %g3
+0x0000002c clr  \[ %g1 \]
+0x00000030 nop 
diff --git a/gas/testsuite/gas/sparc/natural-32.s b/gas/testsuite/gas/sparc/natural-32.s
index 2a51441..544d170 100644
--- a/gas/testsuite/gas/sparc/natural-32.s
+++ b/gas/testsuite/gas/sparc/natural-32.s
@@ -2,4 +2,14 @@
         .text
         ba %ncc, 0f
          nop
+        ldn [%g1], %g2
+        ldna [%g1]#ASI_AIUP, %g2
+        stn %g1, [%g2]
+        stna %g1, [%g2]#ASI_AIUP
+        slln %g1, 10, %g2
+        srln %g1, 10, %g2
+        sran %g1, 10, %g2
+        casn [%g1], %g2, %g3
+        casna [%g1]#ASI_AIUP, %g2, %g3
+        clrn [%g1]
 0:      nop
diff --git a/gas/testsuite/gas/sparc/natural.d b/gas/testsuite/gas/sparc/natural.d
index e29c251..d0c1446 100644
--- a/gas/testsuite/gas/sparc/natural.d
+++ b/gas/testsuite/gas/sparc/natural.d
@@ -5,6 +5,16 @@
 .*: +file format .*
 
 Disassembly of section .text:
-0x0+0000000 b  %xcc, 0x0+0000008
+0x0+0000000 b  %xcc, 0x0+0000030
 0x0+0000004 nop 
-0x0+0000008 nop 
+0x0+0000008 ldx  \[ %g1 \], %g2
+0x0+000000c ldxa  \[ %g1 \] #ASI_AIUP, %g2
+0x0+0000010 stx  %g1, \[ %g2 \]
+0x0+0000014 stxa  %g1, \[ %g2 \] #ASI_AIUP
+0x0+0000018 sllx  %g1, 0xa, %g2
+0x0+000001c srlx  %g1, 0xa, %g2
+0x0+0000020 srax  %g1, 0xa, %g2
+0x0+0000024 casx  \[ %g1 \], %g2, %g3
+0x0+0000028 casxa  \[ %g1 \] #ASI_AIUP, %g2, %g3
+0x0+000002c clrx  \[ %g1 \]
+0x0+0000030 nop 
diff --git a/gas/testsuite/gas/sparc/natural.s b/gas/testsuite/gas/sparc/natural.s
index 2a51441..544d170 100644
--- a/gas/testsuite/gas/sparc/natural.s
+++ b/gas/testsuite/gas/sparc/natural.s
@@ -2,4 +2,14 @@
         .text
         ba %ncc, 0f
          nop
+        ldn [%g1], %g2
+        ldna [%g1]#ASI_AIUP, %g2
+        stn %g1, [%g2]
+        stna %g1, [%g2]#ASI_AIUP
+        slln %g1, 10, %g2
+        srln %g1, 10, %g2
+        sran %g1, 10, %g2
+        casn [%g1], %g2, %g3
+        casna [%g1]#ASI_AIUP, %g2, %g3
+        clrn [%g1]
 0:      nop
-- 
2.3.4

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

* [PATH 1/3] gas: support for the sparc %ncc condition codes register.
  2015-05-01 17:39 [PATH 0/3] [SPARC] Support for %ncc and tests for the "natural" insns Jose E. Marchesi
  2015-05-01 17:39 ` [PATH 3/3] gas: typo in comment fixed Jose E. Marchesi
  2015-05-01 17:39 ` [PATH 2/3] gas: added tests for the sparc natural instructions Jose E. Marchesi
@ 2015-05-01 17:39 ` Jose E. Marchesi
  2015-05-06 11:48 ` [PATH 0/3] [SPARC] Support for %ncc and tests for the "natural" insns Nicholas Clifton
  3 siblings, 0 replies; 6+ messages in thread
From: Jose E. Marchesi @ 2015-05-01 17:39 UTC (permalink / raw)
  To: binutils

gas/ChangeLog:

2015-05-01  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-01  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                        |  6 ++++++
 gas/config/tc-sparc.c                |  6 ++++--
 gas/doc/c-sparc.texi                 |  4 ++++
 gas/testsuite/ChangeLog              | 10 ++++++++++
 gas/testsuite/gas/sparc/natural-32.d | 10 ++++++++++
 gas/testsuite/gas/sparc/natural-32.s |  5 +++++
 gas/testsuite/gas/sparc/natural.d    | 10 ++++++++++
 gas/testsuite/gas/sparc/natural.s    |  5 +++++
 gas/testsuite/gas/sparc/sparc.exp    |  2 ++
 9 files changed, 56 insertions(+), 2 deletions(-)
 create mode 100644 gas/testsuite/gas/sparc/natural-32.d
 create mode 100644 gas/testsuite/gas/sparc/natural-32.s
 create mode 100644 gas/testsuite/gas/sparc/natural.d
 create mode 100644 gas/testsuite/gas/sparc/natural.s

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 8259f05..e55cb5b 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2015-05-01  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-01  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* config/tc-i386.c (i386_elf_emit_arch_note): Removed.
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 60bdcc6..3ffe74f 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -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;
diff --git a/gas/doc/c-sparc.texi b/gas/doc/c-sparc.texi
index aedf25c..f482e3a 100644
--- a/gas/doc/c-sparc.texi
+++ b/gas/doc/c-sparc.texi
@@ -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}}.
 
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index e1fda77..75fc289 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2015-05-01  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-01  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* gas/i386/i386.exp: Run note.
diff --git a/gas/testsuite/gas/sparc/natural-32.d b/gas/testsuite/gas/sparc/natural-32.d
new file mode 100644
index 0000000..039e45e
--- /dev/null
+++ b/gas/testsuite/gas/sparc/natural-32.d
@@ -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
index 0000000..2a51441
--- /dev/null
+++ b/gas/testsuite/gas/sparc/natural-32.s
@@ -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
index 0000000..e29c251
--- /dev/null
+++ b/gas/testsuite/gas/sparc/natural.d
@@ -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
index 0000000..2a51441
--- /dev/null
+++ b/gas/testsuite/gas/sparc/natural.s
@@ -0,0 +1,5 @@
+# Test SPARC "natural" registers and instructions
+        .text
+        ba %ncc, 0f
+         nop
+0:      nop
diff --git a/gas/testsuite/gas/sparc/sparc.exp b/gas/testsuite/gas/sparc/sparc.exp
index 36113f6..874f795 100644
--- a/gas/testsuite/gas/sparc/sparc.exp
+++ b/gas/testsuite/gas/sparc/sparc.exp
@@ -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" ""
 }
-- 
2.3.4

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

* [PATH 3/3] gas: typo in comment fixed.
  2015-05-01 17:39 [PATH 0/3] [SPARC] Support for %ncc and tests for the "natural" insns Jose E. Marchesi
@ 2015-05-01 17:39 ` Jose E. Marchesi
  2015-05-01 17:39 ` [PATH 2/3] gas: added tests for the sparc natural instructions Jose E. Marchesi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Jose E. Marchesi @ 2015-05-01 17:39 UTC (permalink / raw)
  To: binutils

gas/ChangeLog:

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

	* config/tc-sparc.c: Typo in comment fixed.
---
 gas/ChangeLog         | 4 ++++
 gas/config/tc-sparc.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index e55cb5b..7990d17 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,9 @@
 2015-05-01  Jose E. Marchesi  <jose.marchesi@oracle.com>
 
+	* config/tc-sparc.c: Typo in comment fixed.
+
+2015-05-01  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.
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 3ffe74f..e468732 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -1211,7 +1211,7 @@ synthetize_setsw (const struct sparc_opcode *insn)
   output_insn (insn, &the_insn);
 }
 
-/* Handle the setsw synthetic instruction.  */
+/* Handle the setx synthetic instruction.  */
 
 static void
 synthetize_setx (const struct sparc_opcode *insn)
-- 
2.3.4

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

* [PATH 0/3] [SPARC] Support for %ncc and tests for the "natural" insns
@ 2015-05-01 17:39 Jose E. Marchesi
  2015-05-01 17:39 ` [PATH 3/3] gas: typo in comment fixed Jose E. Marchesi
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Jose E. Marchesi @ 2015-05-01 17:39 UTC (permalink / raw)
  To: binutils

Hi Nick!

The first patch adds support for the %ncc "natural" condition codes in
sparc.  This refers to %icc when as in invoked with -32 and %xcc when
as in invoked with -64.  Supporting these condition codes makes it
much easier to port applications from Solaris to GNU/Linux.

The second patch adds a few tests for the already supported natural
instructions: ldn, ldna, stn, stna, slln, srln, sran, casn, casna and
clrn.

Finally, the third patch fixes a tiny typo in a comment.

Ok to commit?

Jose E. Marchesi (3):
  gas: support for the sparc %ncc condition codes register.
  gas: added tests for the sparc natural instructions.
  gas: typo in comment fixed.

 gas/ChangeLog                        | 10 ++++++++++
 gas/config/tc-sparc.c                |  8 +++++---
 gas/doc/c-sparc.texi                 |  4 ++++
 gas/testsuite/ChangeLog              | 18 ++++++++++++++++++
 gas/testsuite/gas/sparc/natural-32.d | 20 ++++++++++++++++++++
 gas/testsuite/gas/sparc/natural-32.s | 15 +++++++++++++++
 gas/testsuite/gas/sparc/natural.d    | 20 ++++++++++++++++++++
 gas/testsuite/gas/sparc/natural.s    | 15 +++++++++++++++
 gas/testsuite/gas/sparc/sparc.exp    |  2 ++
 9 files changed, 109 insertions(+), 3 deletions(-)
 create mode 100644 gas/testsuite/gas/sparc/natural-32.d
 create mode 100644 gas/testsuite/gas/sparc/natural-32.s
 create mode 100644 gas/testsuite/gas/sparc/natural.d
 create mode 100644 gas/testsuite/gas/sparc/natural.s

-- 
2.3.4

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

* Re: [PATH 0/3] [SPARC] Support for %ncc and tests for the "natural" insns
  2015-05-01 17:39 [PATH 0/3] [SPARC] Support for %ncc and tests for the "natural" insns Jose E. Marchesi
                   ` (2 preceding siblings ...)
  2015-05-01 17:39 ` [PATH 1/3] gas: support for the sparc %ncc condition codes register Jose E. Marchesi
@ 2015-05-06 11:48 ` Nicholas Clifton
  2015-05-06 16:37   ` Jose E. Marchesi
  3 siblings, 1 reply; 6+ messages in thread
From: Nicholas Clifton @ 2015-05-06 11:48 UTC (permalink / raw)
  To: Jose E. Marchesi, binutils

Hi Jose,

> Hi Nick!

[It is not just me - lots of people read this list, and many of them 
like to comment on patches, and quite a few of us have approval privileges].

> Ok to commit?

Yes - these look fine.  Please apply (all 3 patches).

Cheers
   Nick

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

* Re: [PATH 0/3] [SPARC] Support for %ncc and tests for the "natural" insns
  2015-05-06 11:48 ` [PATH 0/3] [SPARC] Support for %ncc and tests for the "natural" insns Nicholas Clifton
@ 2015-05-06 16:37   ` Jose E. Marchesi
  0 siblings, 0 replies; 6+ messages in thread
From: Jose E. Marchesi @ 2015-05-06 16:37 UTC (permalink / raw)
  To: Nicholas Clifton; +Cc: binutils

    
    > Ok to commit?
    
    Yes - these look fine.  Please apply (all 3 patches).
    
Pushed, thanks!

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

end of thread, other threads:[~2015-05-06 16:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-01 17:39 [PATH 0/3] [SPARC] Support for %ncc and tests for the "natural" insns Jose E. Marchesi
2015-05-01 17:39 ` [PATH 3/3] gas: typo in comment fixed Jose E. Marchesi
2015-05-01 17:39 ` [PATH 2/3] gas: added tests for the sparc natural instructions Jose E. Marchesi
2015-05-01 17:39 ` [PATH 1/3] gas: support for the sparc %ncc condition codes register Jose E. Marchesi
2015-05-06 11:48 ` [PATH 0/3] [SPARC] Support for %ncc and tests for the "natural" insns Nicholas Clifton
2015-05-06 16:37   ` Jose E. Marchesi

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