[patch, simulator, mips] Add rdhwr instruction to mips simulator

Steve Ellcey sellcey@mips.com
Wed Oct 3 19:34:00 GMT 2012

While testing GCC with the mips-mti-elf target and using the GNU simulator
I noticed that some tests (like gcc.dg/builtins-64.c) were failing on mips32r2
with synci enabled.  This is because the rdhwr instruction was not implemented
in the simulator.

This patch (created by Chao-ying and tested by me) adds the rdhwr instruction
to the mips simulator and fixes the gcc.dg/builtins-64.c failure.

OK to checkin?

Steve Ellcey

2012-10-04  Chao-ying Fu  <fu@mips.com>
	    Steve Ellcey  <sellcey@mips.com>

	* mips/mips3264r2.igen (rdhwr): New.

diff --git a/sim/mips/mips3264r2.igen b/sim/mips/mips3264r2.igen
index c52ec3b..e0b6d5b 100644
--- a/sim/mips/mips3264r2.igen
+++ b/sim/mips/mips3264r2.igen
@@ -241,6 +241,17 @@
+"rdhwr r<RT>, r<RD>"
+  // Return 0 for all hardware registers currently
+  GPR[RT] = EXTEND32 (0);
 "wsbh r<RD>, r<RT>"

More information about the Gdb-patches mailing list