aboutsummaryrefslogtreecommitdiff
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
parent9fe7d4f656dd3c6bfe6be17d2e48eacb59ad00f5 (diff)
downloadpk-664411d5e692b487409dfb1c2ede9e214dd15602.zip
pk-664411d5e692b487409dfb1c2ede9e214dd15602.tar.gz
pk-664411d5e692b487409dfb1c2ede9e214dd15602.tar.bz2
[opcodes, pk, sim, xcc] made jumps shorter and PC-relative
-rw-r--r--Makefile.in2
-rw-r--r--config.h.in6
-rwxr-xr-xconfigure2
-rw-r--r--configure.ac2
-rw-r--r--pk/pk.ld62
-rw-r--r--pk/riscv-opc.h6
6 files changed, 13 insertions, 67 deletions
diff --git a/Makefile.in b/Makefile.in
index 5239d00..05e6dc4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -91,7 +91,7 @@ COMPILE := $(CC) -MMD -MP $(CFLAGS) \
# - LIBS : Library flags (eg. -l)
LD := $(CC)
-LDFLAGS := @LDFLAGS@
+LDFLAGS := @LDFLAGS@ -nostartfiles -nostdlib
LIBS := @LIBS@
LINK := $(LD) $(LDFLAGS) -T $(src_dir)/pk/pk.ld
diff --git a/config.h.in b/config.h.in
index 0bb21e0..dce08f0 100644
--- a/config.h.in
+++ b/config.h.in
@@ -30,5 +30,11 @@
/* Define if virtual memory support is enabled */
#undef PK_ENABLE_VM
+/* Define if subproject MCPPBS_SPROJ_NORM is enabled */
+#undef SOFTFLOAT_ENABLED
+
+/* Define if subproject MCPPBS_SPROJ_NORM is enabled */
+#undef SOFTFLOAT_RISCV_ENABLED
+
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
diff --git a/configure b/configure
index 35f548d..f1d154a 100755
--- a/configure
+++ b/configure
@@ -3909,7 +3909,7 @@ fi
# Default compiler flags
#-------------------------------------------------------------------------
-CFLAGS="-Wall -O3 -std=gnu99"
+CFLAGS="-Wall -Os -std=gnu99"
#-------------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 33b3d09..45bbaae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,7 +71,7 @@ AC_HEADER_STDC
# Default compiler flags
#-------------------------------------------------------------------------
-AC_SUBST([CFLAGS], ["-Wall -O3 -std=gnu99"])
+AC_SUBST([CFLAGS], ["-Wall -Os -std=gnu99"])
#-------------------------------------------------------------------------
# MCPPBS subproject list
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