Enable mips16e instruction set for all user binaries.
This commit is contained in:
@@ -2,7 +2,7 @@ TOPSRC = $(shell cd ..; pwd)
|
|||||||
SUBDIR = startup libc libm libcurses libtermlib libwiznet libreadline libgpanel
|
SUBDIR = startup libc libm libcurses libtermlib libwiznet libreadline libgpanel
|
||||||
PROG = ar as aout ld nm ranlib size strip
|
PROG = ar as aout ld nm ranlib size strip
|
||||||
|
|
||||||
CFLAGS += -std=gnu89 -fno-builtin -g -Werror -Wall -DCROSS -I. \
|
CFLAGS = -Os -std=gnu89 -fno-builtin -g -Werror -Wall -DCROSS -I. \
|
||||||
-idirafter $(TOPSRC)/include \
|
-idirafter $(TOPSRC)/include \
|
||||||
-idirafter $(TOPSRC)/src/cmd/ar \
|
-idirafter $(TOPSRC)/src/cmd/ar \
|
||||||
-idirafter $(TOPSRC)/src/cmd/as
|
-idirafter $(TOPSRC)/src/cmd/as
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ vpath %.c $(LIBCDIR)/mips/sys $(LIBCDIR)/gen $(LIBCDIR)/stdio \
|
|||||||
$(LIBCDIR)/stdlib $(LIBCDIR)/string $(LIBCDIR)/inet \
|
$(LIBCDIR)/stdlib $(LIBCDIR)/string $(LIBCDIR)/inet \
|
||||||
$(LIBCDIR)/compat $(LIBCDIR)/runtime
|
$(LIBCDIR)/compat $(LIBCDIR)/runtime
|
||||||
|
|
||||||
CFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
ASFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -I$(LIBCDIR)/mips/sys
|
ASFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -I$(LIBCDIR)/mips/sys
|
||||||
|
|
||||||
# modules which can not use SYSCALL and must be assembled from sources. The
|
# modules which can not use SYSCALL and must be assembled from sources. The
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ include $(TOPSRC)/target.mk
|
|||||||
|
|
||||||
vpath %.c $(TOPSRC)/src/libcurses
|
vpath %.c $(TOPSRC)/src/libcurses
|
||||||
|
|
||||||
CFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
|
|
||||||
OBJS = addch.o addstr.o box.o clear.o clrtobot.o clrtoeol.o cr_put.o \
|
OBJS = addch.o addstr.o box.o clear.o clrtobot.o clrtoeol.o cr_put.o \
|
||||||
cr_tty.o curses.o delch.o deleteln.o delwin.o endwin.o erase.o \
|
cr_tty.o curses.o delch.o deleteln.o delwin.o endwin.o erase.o \
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ include $(TOPSRC)/target.mk
|
|||||||
|
|
||||||
vpath %.c $(TOPSRC)/src/libgpanel
|
vpath %.c $(TOPSRC)/src/libgpanel
|
||||||
|
|
||||||
CFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
|
|
||||||
OBJS = open.o clear.o pixel.o line.o rect.o fill.o circle.o \
|
OBJS = open.o clear.o pixel.o line.o rect.o fill.o circle.o \
|
||||||
image.o char.o text.o text_width.o
|
image.o char.o text.o text_width.o
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ include $(TOPSRC)/target.mk
|
|||||||
|
|
||||||
vpath %.c $(TOPSRC)/src/libm
|
vpath %.c $(TOPSRC)/src/libm
|
||||||
|
|
||||||
CFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
|
|
||||||
OBJS = asin.o atan.o exp.o erf.o floor.o fmod.o hypot.o j0.o j1.o \
|
OBJS = asin.o atan.o exp.o erf.o floor.o fmod.o hypot.o j0.o j1.o \
|
||||||
jn.o log.o pow.o sin.o sinh.o sqrt.o tan.o tanh.o
|
jn.o log.o pow.o sin.o sinh.o sqrt.o tan.o tanh.o
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ include $(TOPSRC)/target.mk
|
|||||||
|
|
||||||
vpath %.c $(TOPSRC)/src/libreadline
|
vpath %.c $(TOPSRC)/src/libreadline
|
||||||
|
|
||||||
CFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
|
|
||||||
OBJS = readline.o
|
OBJS = readline.o
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ include $(TOPSRC)/target.mk
|
|||||||
|
|
||||||
vpath %.c $(TOPSRC)/src/libtermlib
|
vpath %.c $(TOPSRC)/src/libtermlib
|
||||||
|
|
||||||
CFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
|
|
||||||
OBJS = termcap.o tgoto.o tputs.o tcattr.o
|
OBJS = termcap.o tgoto.o tputs.o tcattr.o
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ include $(TOPSRC)/target.mk
|
|||||||
|
|
||||||
vpath %.c $(TOPSRC)/src/libwiznet
|
vpath %.c $(TOPSRC)/src/libwiznet
|
||||||
|
|
||||||
CFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
|
|
||||||
OBJS = w5100.o socket.o ethernet.o client.o server.o udp.o
|
OBJS = w5100.o socket.o ethernet.o client.o server.o udp.o
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ TOPSRC = $(shell cd ../..; pwd)
|
|||||||
include $(TOPSRC)/target.mk
|
include $(TOPSRC)/target.mk
|
||||||
vpath %.c $(TOPSRC)/src/startup-mips
|
vpath %.c $(TOPSRC)/src/startup-mips
|
||||||
|
|
||||||
CFLAGS = -B$(TOPSRC)/lib/ -O -Wa,-x $(DEFS)
|
CFLAGS = -Os -B$(TOPSRC)/lib/ -Wa,-x $(DEFS)
|
||||||
|
|
||||||
OBJS = ../crt0.o
|
OBJS = ../crt0.o
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ SUBDIR = adb adc-demo aout ar as awk basic calendar cc chflags \
|
|||||||
man md5 med more nm passwd pdc picoc portio printf pwm \
|
man md5 med more nm passwd pdc picoc portio printf pwm \
|
||||||
ranlib re renice retroforth scm sed setty sh sl smallc \
|
ranlib re renice retroforth scm sed setty sh sl smallc \
|
||||||
smlrc smux stty sysctl test uname wiznet xargs \
|
smlrc smux stty sysctl test uname wiznet xargs \
|
||||||
zmodem gtest msec unixbench cron compress date2 tip \
|
zmodem gtest msec cron compress date2 tip \
|
||||||
talloc uucp
|
talloc uucp
|
||||||
|
|
||||||
# /sbin
|
# /sbin
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ delete(argv)
|
|||||||
SETCF(tfd, tname, afd, archive, NOPAD);
|
SETCF(tfd, tname, afd, archive, NOPAD);
|
||||||
copy_ar(&cf, size);
|
copy_ar(&cf, size);
|
||||||
(void)close(tfd);
|
(void)close(tfd);
|
||||||
(void)ftruncate(afd, size + SARMAG);
|
if (ftruncate(afd, size + SARMAG) < 0)
|
||||||
|
/* ignore */;
|
||||||
close_archive(afd);
|
close_archive(afd);
|
||||||
|
|
||||||
if (*argv) {
|
if (*argv) {
|
||||||
|
|||||||
@@ -136,7 +136,8 @@ move(argv)
|
|||||||
cf.rfd = tfd3;
|
cf.rfd = tfd3;
|
||||||
copy_ar(&cf, size);
|
copy_ar(&cf, size);
|
||||||
|
|
||||||
(void)ftruncate(afd, tsize + SARMAG);
|
if (ftruncate(afd, tsize + SARMAG) < 0)
|
||||||
|
/* ignore */;
|
||||||
close_archive(afd);
|
close_archive(afd);
|
||||||
|
|
||||||
if (*argv) {
|
if (*argv) {
|
||||||
|
|||||||
@@ -190,7 +190,8 @@ append: while ((file = *argv++) != 0) {
|
|||||||
cf.rfd = tfd2;
|
cf.rfd = tfd2;
|
||||||
copy_ar(&cf, size);
|
copy_ar(&cf, size);
|
||||||
|
|
||||||
(void)ftruncate(afd, tsize + SARMAG);
|
if (ftruncate(afd, tsize + SARMAG) < 0)
|
||||||
|
/* ignore */;
|
||||||
close_archive(afd);
|
close_archive(afd);
|
||||||
return(err);
|
return(err);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1568,7 +1568,8 @@ int main (argc, argv)
|
|||||||
|
|
||||||
if (! ofilfnd) {
|
if (! ofilfnd) {
|
||||||
unlink ("a.out");
|
unlink ("a.out");
|
||||||
link ("l.out", "a.out");
|
if (link ("l.out", "a.out") < 0)
|
||||||
|
perror("a.out");
|
||||||
ofilename = "a.out";
|
ofilename = "a.out";
|
||||||
}
|
}
|
||||||
delarg = errlev;
|
delarg = errlev;
|
||||||
|
|||||||
@@ -385,7 +385,8 @@ int build()
|
|||||||
(void)lseek(tfd, (off_t)0, SEEK_SET);
|
(void)lseek(tfd, (off_t)0, SEEK_SET);
|
||||||
SETCF(tfd, tname, afd, archive, RPAD|WPAD);
|
SETCF(tfd, tname, afd, archive, RPAD|WPAD);
|
||||||
copy_ar(&cf, size);
|
copy_ar(&cf, size);
|
||||||
(void)ftruncate(afd, lseek(afd, (off_t)0, SEEK_CUR));
|
if (ftruncate(afd, lseek(afd, (off_t)0, SEEK_CUR)) < 0)
|
||||||
|
/* ignore */;
|
||||||
(void)close(tfd);
|
(void)close(tfd);
|
||||||
|
|
||||||
/* Set the time. */
|
/* Set the time. */
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ strip(name)
|
|||||||
head.a_reldata = 0;
|
head.a_reldata = 0;
|
||||||
head.a_syms = 0;
|
head.a_syms = 0;
|
||||||
(void) lseek(f, (off_t)0, SEEK_SET);
|
(void) lseek(f, (off_t)0, SEEK_SET);
|
||||||
(void) write(f, (char *)&head, sizeof (head));
|
if (write(f, (char *)&head, sizeof (head)) != sizeof (head))
|
||||||
|
/* ignore */;
|
||||||
out:
|
out:
|
||||||
close(f);
|
close(f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ OPTON = -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall
|
|||||||
#CFLAGS = -DTIME -std1 -verbose -w0
|
#CFLAGS = -DTIME -std1 -verbose -w0
|
||||||
|
|
||||||
## generic gcc CFLAGS. -DTIME must be included
|
## generic gcc CFLAGS. -DTIME must be included
|
||||||
CFLAGS = -DTIME -Wall -pedantic -ansi
|
#CFLAGS = -DTIME -Wall -pedantic -ansi
|
||||||
|
|
||||||
# local directories
|
# local directories
|
||||||
PROGDIR = ./pgms
|
PROGDIR = ./pgms
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ TOPSRC = $(shell cd ../../..; pwd)
|
|||||||
include $(TOPSRC)/target.mk
|
include $(TOPSRC)/target.mk
|
||||||
#include $(TOPSRC)/cross.mk
|
#include $(TOPSRC)/cross.mk
|
||||||
|
|
||||||
CFLAGS = -Os -g -Werror -Wall
|
CFLAGS += -Os -g -Werror -Wall
|
||||||
CFLAGS += -DBSD -DDEST=\"/games/lib/atc/\"
|
CFLAGS += -DBSD -DDEST=\"/games/lib/atc/\"
|
||||||
#CFLAGS += -DSYSV -DDEST=\"games/\"
|
#CFLAGS += -DSYSV -DDEST=\"games/\"
|
||||||
YFLAGS = -d
|
YFLAGS = -d
|
||||||
|
|||||||
@@ -1,7 +1,33 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "ieee.h"
|
typedef union {
|
||||||
|
double value;
|
||||||
|
struct {
|
||||||
|
uint32_t lo;
|
||||||
|
uint32_t hi;
|
||||||
|
} uns;
|
||||||
|
} union64_t;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get two 32 bit ints from a double.
|
||||||
|
*/
|
||||||
|
#define EXTRACT_WORDS(high,low,d) {\
|
||||||
|
union64_t u = {0}; \
|
||||||
|
u.value = d; \
|
||||||
|
high = u.uns.hi; \
|
||||||
|
low = u.uns.lo; \
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set a double from two 32 bit ints.
|
||||||
|
*/
|
||||||
|
#define INSERT_WORDS(d,high,low) { \
|
||||||
|
union64_t u = {0}; \
|
||||||
|
u.uns.hi = high; \
|
||||||
|
u.uns.lo = low; \
|
||||||
|
d = u.value; \
|
||||||
|
}
|
||||||
|
|
||||||
static const double one = 1.0, Zero[] = {0.0, -0.0,};
|
static const double one = 1.0, Zero[] = {0.0, -0.0,};
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
/* Get two 32 bit ints from a double. */
|
|
||||||
|
|
||||||
#define EXTRACT_WORDS(high,low,d) \
|
|
||||||
high = *(unsigned long long*) &d; \
|
|
||||||
low = (*(unsigned long long*) &d) >> 32
|
|
||||||
|
|
||||||
|
|
||||||
/* Set a double from two 32 bit ints. */
|
|
||||||
|
|
||||||
#define INSERT_WORDS(d,high,low) \
|
|
||||||
*(unsigned long long*) &(x) = (unsigned long long) (high) << 32 | (low)
|
|
||||||
|
|
||||||
|
|
||||||
typedef union
|
|
||||||
{
|
|
||||||
double value;
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
uint32_t lsw;
|
|
||||||
uint32_t msw;
|
|
||||||
} parts;
|
|
||||||
} ieee_double_shape_type;
|
|
||||||
|
|
||||||
@@ -85,3 +85,6 @@ CFLAGS = -O
|
|||||||
LDFLAGS += -N -nostartfiles -fno-dwarf2-cfi-asm -T$(TOPSRC)/src/elf32-mips.ld \
|
LDFLAGS += -N -nostartfiles -fno-dwarf2-cfi-asm -T$(TOPSRC)/src/elf32-mips.ld \
|
||||||
$(TOPSRC)/src/crt0.o -L$(TOPSRC)/src
|
$(TOPSRC)/src/crt0.o -L$(TOPSRC)/src
|
||||||
LIBS = -lc
|
LIBS = -lc
|
||||||
|
|
||||||
|
# Enable mips16e instruction set by default
|
||||||
|
CFLAGS += -mips16
|
||||||
|
|||||||
Reference in New Issue
Block a user