mirror of
https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
synced 2024-12-29 13:03:42 +01:00
WIP: Enable build on aarch64
This commit is contained in:
parent
960fdbf8bd
commit
019990ecb7
4 changed files with 12 additions and 6 deletions
3
Make.inc
3
Make.inc
|
@ -73,6 +73,9 @@ REAL_ARCH := $(ARCH)
|
||||||
ifeq ($(findstring arm,$(ARCH)),arm)
|
ifeq ($(findstring arm,$(ARCH)),arm)
|
||||||
override ARCH := arm
|
override ARCH := arm
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(ARCH),aarch64)
|
||||||
|
override ARCH := arm
|
||||||
|
endif
|
||||||
ifeq ($(findstring powerpc,$(ARCH)),powerpc)
|
ifeq ($(findstring powerpc,$(ARCH)),powerpc)
|
||||||
override ARCH := powerpc
|
override ARCH := powerpc
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -128,16 +128,16 @@ tgamma(x)
|
||||||
{
|
{
|
||||||
struct Double u;
|
struct Double u;
|
||||||
|
|
||||||
if (x >= 6) {
|
if (isgreaterequal(x, 6)) {
|
||||||
if(x > 171.63)
|
if(x > 171.63)
|
||||||
return (x / zero);
|
return (x / zero);
|
||||||
u = large_gam(x);
|
u = large_gam(x);
|
||||||
return(__exp__D(u.a, u.b));
|
return(__exp__D(u.a, u.b));
|
||||||
} else if (x >= 1.0 + LEFT + x0)
|
} else if (isgreaterequal(x, 1.0 + LEFT + x0))
|
||||||
return (small_gam(x));
|
return (small_gam(x));
|
||||||
else if (x > 1.e-17)
|
else if (isgreater(x, 1.e-17))
|
||||||
return (smaller_gam(x));
|
return (smaller_gam(x));
|
||||||
else if (x > -1.e-17) {
|
else if (isgreater(x, -1.e-17)) {
|
||||||
if (x != 0.0)
|
if (x != 0.0)
|
||||||
u.a = one - tiny; /* raise inexact */
|
u.a = one - tiny; /* raise inexact */
|
||||||
return (one/x);
|
return (one/x);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <fenv.h>
|
#include <fenv.h>
|
||||||
#else /* !OPENLIBM_USE_HOST_FENV_H */
|
#else /* !OPENLIBM_USE_HOST_FENV_H */
|
||||||
|
|
||||||
#if defined(__arm__)
|
#if defined(__aarch64__) || defined(__arm__)
|
||||||
#include <openlibm_fenv_arm.h>
|
#include <openlibm_fenv_arm.h>
|
||||||
#elif defined(__x86_64__)
|
#elif defined(__x86_64__)
|
||||||
#include <openlibm_fenv_amd64.h>
|
#include <openlibm_fenv_amd64.h>
|
||||||
|
|
|
@ -64,7 +64,10 @@ extern const fenv_t __fe_dfl_env;
|
||||||
#define _FPUSW_SHIFT 16
|
#define _FPUSW_SHIFT 16
|
||||||
#define _ENABLE_MASK (FE_ALL_EXCEPT << _FPUSW_SHIFT)
|
#define _ENABLE_MASK (FE_ALL_EXCEPT << _FPUSW_SHIFT)
|
||||||
|
|
||||||
#ifdef ARM_HARD_FLOAT
|
#if defined(__aarch64__)
|
||||||
|
#define __rfs(__fpsr) __asm __volatile("mrs %0,fpsr" : "=r" (*(__fpsr)))
|
||||||
|
#define __wfs(__fpsr) __asm __volatile("msr fpsr,%0" : : "r" (__fpsr))
|
||||||
|
#elif defined(ARM_HARD_FLOAT)
|
||||||
#define __rfs(__fpsr) __asm __volatile("rfs %0" : "=r" (*(__fpsr)))
|
#define __rfs(__fpsr) __asm __volatile("rfs %0" : "=r" (*(__fpsr)))
|
||||||
#define __wfs(__fpsr) __asm __volatile("wfs %0" : : "r" (__fpsr))
|
#define __wfs(__fpsr) __asm __volatile("wfs %0" : : "r" (__fpsr))
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue