aboutsummaryrefslogtreecommitdiff
path: root/pk
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@s144.Millennium.Berkeley.EDU>2010-11-02 12:19:52 -0700
committerAndrew Waterman <waterman@s144.Millennium.Berkeley.EDU>2010-11-21 16:54:32 -0800
commit664411d5e692b487409dfb1c2ede9e214dd15602 (patch)
treef3ce1f0270fe0f8a93f2de52475c95fc681f10e8 /pk
parent9fe7d4f656dd3c6bfe6be17d2e48eacb59ad00f5 (diff)
downloadpk-664411d5e692b487409dfb1c2ede9e214dd15602.zip
pk-664411d5e692b487409dfb1c2ede9e214dd15602.tar.gz
pk-664411d5e692b487409dfb1c2ede9e214dd15602.tar.bz2
[opcodes, pk, sim, xcc] made jumps shorter and PC-relative
Diffstat (limited to 'pk')
-rw-r--r--pk/pk.ld62
-rw-r--r--pk/riscv-opc.h6
2 files changed, 4 insertions, 64 deletions
diff --git a/pk/pk.ld b/pk/pk.ld
index 5dd3ce4..0ccf7ef 100644
--- a/pk/pk.ld
+++ b/pk/pk.ld
@@ -2,8 +2,7 @@ OUTPUT_ARCH( "mips:riscv" )
ENTRY( __start )
-GROUP( -lc -lgloss -lgcc )
-
+GROUP( -lc -lgcc -lgloss )
SECTIONS
{
@@ -31,18 +30,6 @@ SECTIONS
*(.gnu.linkonce.t.*)
}
- /* init: Code to execute before main (called by crt1.S) */
- .init :
- {
- KEEP( *(.init) )
- }
-
- /* fini: Code to execute after main (called by crt1.S) */
- .fini :
- {
- KEEP( *(.fini) )
- }
-
/* rodata: Read-only data */
.rodata :
{
@@ -57,53 +44,6 @@ SECTIONS
_etext = .;
/*--------------------------------------------------------------------*/
- /* Global constructor/destructor segement */
- /*--------------------------------------------------------------------*/
- /* The .ctors/.dtors sections are special sections which contain a
- list of constructor/destructor function pointers. crtbegin.o
- includes code in a .init section which goes through the .ctors list
- and calls each constuctor. crtend.o includes code in a .fini
- section which goes through the .dtors list and calls each
- destructor. crtbegin.o includes a special null pointer in its own
- .ctors/.dtors sections which acts as a start indicator for those
- lists. crtend.o also includes a special null pointer in its own
- .ctors/.dtors sections which acts as an end indictor. The linker
- commands below are setup so that crtbegin.o's .ctors/.dtors
- sections are always first and crtend.o's .ctors/.dtors sections are
- always last. This is the only way the list of functions will have
- the begin and end indicators in the right place. */
-
- /* ctors : Array of global constructor function pointers */
- .ctors :
- {
- KEEP( *crtbegin.o(.ctors) )
- KEEP( *(EXCLUDE_FILE(*crtend.o) .ctors) )
- KEEP( *(SORT(.ctors.*)) )
- KEEP( *(.ctors) )
- }
-
- /* dtors : Array of global destructor function pointers */
- .dtors :
- {
- KEEP( *crtbegin.o(.dtors) )
- KEEP( *(EXCLUDE_FILE(*crtend.o) .dtors) )
- KEEP( *(SORT(.dtors.*)) )
- KEEP( *(.dtors) )
- }
-
- /*--------------------------------------------------------------------*/
- /* Other misc gcc segments (this was in idt32.ld) */
- /*--------------------------------------------------------------------*/
- /* I am not quite sure about these sections but it seems they are for
- C++ exception handling. I think .jcr is for "Java Class
- Registration" but it seems to end up in C++ binaries as well. */
-
- .eh_frame_hdr : { *(.eh_frame_hdr) }
- .eh_frame : { KEEP( *(.eh_frame) ) }
- .gcc_except_table : { *(.gcc_except_table) }
- .jcr : { KEEP (*(.jcr)) }
-
- /*--------------------------------------------------------------------*/
/* Initialized data segment */
/*--------------------------------------------------------------------*/
diff --git a/pk/riscv-opc.h b/pk/riscv-opc.h
index 042da63..864014f 100644
--- a/pk/riscv-opc.h
+++ b/pk/riscv-opc.h
@@ -225,8 +225,8 @@
#define MASK_SQRT_S_RM 0xfff067e0
#define MATCH_CVTU_L_D_RM 0xd4006520
#define MASK_CVTU_L_D_RM 0xfff067e0
-#define MATCH_JAL 0xc8000000
-#define MASK_JAL 0xf8000000
+#define MATCH_JAL 0xc2000000
+#define MASK_JAL 0xfe000000
#define MATCH_LWU 0xf0006000
#define MASK_LWU 0xfe007000
#define MATCH_CVT_S_D_RM 0xd4000660
@@ -250,7 +250,7 @@
#define MATCH_SLLW 0xee007040
#define MASK_SLLW 0xfe007fe0
#define MATCH_J 0xc0000000
-#define MASK_J 0xf8000000
+#define MASK_J 0xfe000000
#define MATCH_SLTI 0xe8002000
#define MASK_SLTI 0xfe007000
#define MATCH_REMU 0xea0010e0