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]

Re: [PATCH/SPARC] Support for the %hstick_offset and %hstick_enable registers


[ping]

Hi.  The patch below adds support for the hyperprivileged registers
%hstick_offset and %hstick_enable to the assembler.

Tested on sparc64-*-linux-gnu.  No visible regressions.

gas/ChangeLog:

2014-03-05  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* config/tc-sparc.c (hpriv_reg_table): Added entries for
	%hstick_offset and %hstick_enable.
	* doc/c-sparc.texi (Sparc-Regs): Document the %hstick_offset and
	%hstick_enable hyperprivileged registers.

opcodes/ChangeLog:

2014-03-05  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* sparc-dis.c (v9_hpriv_reg_names): Names for %hstick_offset and
	%hstick_enable added.
        
gas/testsuite/ChangeLog:

2014-03-05  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* gas/sparc/rdhpr.s: Test rd %hstick_offset and %hstick_enable.
	* gas/sparc/rdhpr.d: Likewise.

	* gas/sparc/wrhpr.s: Test wr %hstick_offset and %hstick_enable.
	* gas/sparc/wrhpr.d: Likewise.

--- a/opcodes/sparc-dis.c
+++ b/opcodes/sparc-dis.c
@@ -97,7 +97,7 @@ static char *v9_hpriv_reg_names[] =
   "resv7", "resv8", "resv9", "resv10", "resv11", "resv12", "resv13", 
   "resv14", "resv15", "resv16", "resv17", "resv18", "resv19", "resv20",
   "resv21", "resv22", "resv23", "resv24", "resv25", "resv26", "resv27",
-  "resv28", "resv29", "resv30", "hstick_cmpr"
+  "hstick_offset", "hstick_enable", "resv30", "hstick_cmpr"
 };
 
 /* These are ordered according to there register number in

diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index b1e4dec..fdc2f03 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -787,6 +787,8 @@ struct priv_reg_entry hpriv_reg_table[] =
   {"hintp", 3},
   {"htba", 5},
   {"hver", 6},
+  {"hstick_offset", 28},
+  {"hstick_enable", 29},
   {"hstick_cmpr", 31},
   {"", -1},			/* End marker.  */
 };
diff --git a/gas/testsuite/gas/sparc/rdhpr.d b/gas/testsuite/gas/sparc/rdhpr.d
index fbbd76d..7a12ad3 100644
--- a/gas/testsuite/gas/sparc/rdhpr.d
+++ b/gas/testsuite/gas/sparc/rdhpr.d
@@ -12,4 +12,6 @@ Disassembly of section .text:
    8:	87 48 c0 00 	rdhpr  %hintp, %g3
    c:	89 49 40 00 	rdhpr  %htba, %g4
   10:	8b 49 80 00 	rdhpr  %hver, %g5
-  14:	8d 4f c0 00 	rdhpr  %hstick_cmpr, %g6
+  14:	8d 4f 00 00 	rdhpr  %hstick_offset, %g6
+  18:	8b 4f 40 00 	rdhpr  %hstick_enable, %g5
+  1c:	89 4f c0 00 	rdhpr  %hstick_cmpr, %g4
diff --git a/gas/testsuite/gas/sparc/rdhpr.s b/gas/testsuite/gas/sparc/rdhpr.s
index 5e22f07..8f669c7 100644
--- a/gas/testsuite/gas/sparc/rdhpr.s
+++ b/gas/testsuite/gas/sparc/rdhpr.s
@@ -5,4 +5,6 @@
 	rdhpr %hintp,%g3
 	rdhpr %htba,%g4
 	rdhpr %hver,%g5
-	rdhpr %hstick_cmpr,%g6
+	rdhpr %hstick_offset,%g6
+	rdhpr %hstick_enable,%g5
+	rdhpr %hstick_cmpr,%g4
diff --git a/gas/testsuite/gas/sparc/wrhpr.d b/gas/testsuite/gas/sparc/wrhpr.d
index a9ec2b6..67d7de3 100644
--- a/gas/testsuite/gas/sparc/wrhpr.d
+++ b/gas/testsuite/gas/sparc/wrhpr.d
@@ -11,4 +11,6 @@ Disassembly of section .text:
    4:	83 98 80 00 	wrhpr  %g2, %htstate
    8:	87 98 c0 00 	wrhpr  %g3, %hintp
    c:	8b 99 00 00 	wrhpr  %g4, %htba
-  10:	bf 99 40 00 	wrhpr  %g5, %hstick_cmpr
+  10:	b9 99 40 00 	wrhpr  %g5, %hstick_offset
+  14:	bb 99 80 00 	wrhpr  %g6, %hstick_enable
+  18:	bf 99 c0 00 	wrhpr  %g7, %hstick_cmpr
diff --git a/gas/testsuite/gas/sparc/wrhpr.s b/gas/testsuite/gas/sparc/wrhpr.s
index 838bb53..b93733e 100644
--- a/gas/testsuite/gas/sparc/wrhpr.s
+++ b/gas/testsuite/gas/sparc/wrhpr.s
@@ -4,4 +4,6 @@
 	wrhpr %g2,%htstate
 	wrhpr %g3,%hintp
 	wrhpr %g4,%htba
-	wrhpr %g5,%hstick_cmpr
+	wrhpr %g5,%hstick_offset
+	wrhpr %g6,%hstick_enable
+	wrhpr %g7,%hstick_cmpr
diff --git a/opcodes/sparc-dis.c b/opcodes/sparc-dis.c
index 38b76f7..db09c44 100644
diff --git a/gas/doc/c-sparc.texi b/gas/doc/c-sparc.texi
index 12eb6ed..8915528 100644
--- a/gas/doc/c-sparc.texi
+++ b/gas/doc/c-sparc.texi
@@ -407,9 +407,17 @@ The hyperprivileged implementation version register is referred
 to as @samp{%hver}.
 
 @item
+The hyperprivileged system tick offset register is referred to as
+@samp{%hstick_offset}.  Note that there is no @samp{%hstick} register,
+the normal @samp{%stick} is used.
+
+@item
+The hyperprivileged system tick enable register is referred to as
+@samp{%hstick_enable}.
+
+@item
 The hyperprivileged system tick compare register is referred
-to as @samp{%hstick_cmpr}.  Note that there is no @samp{%hstick}
-register, the normal @samp{%stick} is used.
+to as @samp{%hstick_cmpr}.
 @end itemize
 
 @node Sparc-Constants


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