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
No known key found for this signature in database
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 CFLAGS_arch += -ffreestanding -nostdlib -nostdinc --target=wasm32-unknown-unknown
endif 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 # 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 # we can conveniently get at them for targets that don't want the rest of
# *FLAGS_add, such as the testing Makefile targets # *FLAGS_add, such as the testing Makefile targets

View file

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

View file

@ -14,6 +14,8 @@
#include <openlibm_fenv_mips.h> #include <openlibm_fenv_mips.h>
#elif defined(__s390__) #elif defined(__s390__)
#include <openlibm_fenv_s390.h> #include <openlibm_fenv_s390.h>
#elif defined(__sh3__)
#include <openlibm_fenv_sh3eb.h>
#else #else
#error "Unsupported platform" #error "Unsupported platform"
#endif #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" #include "mips_fpmath.h"
#elif defined(__s390__) #elif defined(__s390__)
#include "s390_fpmath.h" #include "s390_fpmath.h"
#elif defined(__sh3__)
#include "sh3eb_fpmath.h"
#endif #endif
/* Definitions provided directly by GCC and Clang. */ /* Definitions provided directly by GCC and Clang. */

View file

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