llvm-project/libclc/riscv32/lib/compiler-rt/libm.h

64 lines
1.5 KiB
C

/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#ifndef LIBM_H
#define LIBM_H
#define FE_INVALID 1
#define __FE_DENORM 2
#define FE_DIVBYZERO 4
#define FE_OVERFLOW 8
#define FE_UNDERFLOW 16
#define FE_INEXACT 32
#define FE_ALL_EXCEPT 63
#define FE_TONEAREST 0
#define FE_DOWNWARD 0x400
#define FE_UPWARD 0x800
#define FE_TOWARDZERO 0xc00
typedef unsigned short fexcept_t;
typedef struct {
unsigned short __control_word;
unsigned short __unused1;
unsigned short __status_word;
unsigned short __unused2;
unsigned short __tags;
unsigned short __unused3;
unsigned int __eip;
unsigned short __cs_selector;
unsigned int __opcode;
unsigned int __unused4;
unsigned int __data_offset;
unsigned short __data_selector;
unsigned short __unused5;
unsigned int __mxcsr;
} _fenv_t;
#define FE_DFL_ENV ((const fenv_t *)-1)
static int feclearexcept(int mask) { return 0; }
static int feraiseexcept(int mask) { return 0; }
static int _fetestexcept(int mask) { return 0; }
static int fegetround(void) { return FE_TONEAREST; }
static int fesetround(int r) { return 0; }
static int fegetenv(_fenv_t *envp) { return 0; }
static int fesetenv(const _fenv_t *envp) { return 0; }
#endif // LIBM_H