sh3eb: add suport for the sh3eb softfp platform

This commit is contained in:
Lephenixnoir 2020-10-24 12:44:48 +02:00
parent 89b463b811
commit 44c1cbb8eb
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
9 changed files with 24 additions and 2 deletions

View File

@ -131,6 +131,10 @@ ifeq ($(ARCH),wasm32)
CFLAGS_arch += -ffreestanding -nostdlib -nostdinc --target=wasm32-unknown-unknown
endif
ifeq ($(ARCH),sh3eb)
CFLAGS_arch += -ffreestanding -nostdlib -m3 -mb
endif
# Add our "arch"-related FLAGS in. We separate arch-related flags out so that
# we can conveniently get at them for targets that don't want the rest of
# *FLAGS_add, such as the testing Makefile targets

View File

@ -53,7 +53,7 @@ endif
OLM_LIBS := libopenlibm.a
ifneq ($(ARCH), wasm32)
ifeq ($(filter wasm32 sh3eb,$(ARCH)),)
OLM_LIBS += libopenlibm.$(OLM_MAJOR_MINOR_SHLIB_EXT)
endif

View File

@ -14,6 +14,8 @@
#include <openlibm_fenv_mips.h>
#elif defined(__s390__)
#include <openlibm_fenv_s390.h>
#elif defined(__sh3__)
#include <openlibm_fenv_sh3eb.h>
#else
#error "Unsupported platform"
#endif

1
sh3eb/Make.files Normal file
View File

@ -0,0 +1 @@
$(CUR_SRCS) = fenv.c

2
sh3eb/assert.h Normal file
View File

@ -0,0 +1,2 @@
#pragma once
#define assert(b)

7
sh3eb/ctype.h Normal file
View File

@ -0,0 +1,7 @@
#pragma once
static int isxdigit(int c)
{
return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') ||
(c >= 'a' && c <= 'f');
}

4
sh3eb/string.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include <stddef.h>
void *memset(void *mem, int fill, size_t size);

View File

@ -43,6 +43,8 @@
#include "mips_fpmath.h"
#elif defined(__s390__)
#include "s390_fpmath.h"
#elif defined(__sh3__)
#include "sh3eb_fpmath.h"
#endif
/* Definitions provided directly by GCC and Clang. */

View File

@ -29,7 +29,7 @@
union IEEEl2bits {
long double e;
struct {
#ifndef __MIPSEB__
#ifndef __BIG_ENDIAN__
unsigned int manl :32;
unsigned int manh :20;
unsigned int exp :11;