rename:
float16_t -> float16 float32_t -> float32 float64_t -> float64 to fix compilation issues under Android as mentioned in issue #300 also fix bug f16_getExp method
This commit is contained in:
parent
e2823889de
commit
a05f9c85d3
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float16_t extF80_to_f16(extFloat80_t a, struct softfloat_status_t *status)
|
||||
float16 extF80_to_f16(extFloat80_t a, struct softfloat_status_t *status)
|
||||
{
|
||||
uint16_t uiA64;
|
||||
uint64_t uiA0;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float32_t extF80_to_f32(extFloat80_t a, struct softfloat_status_t *status)
|
||||
float32 extF80_to_f32(extFloat80_t a, struct softfloat_status_t *status)
|
||||
{
|
||||
uint16_t uiA64;
|
||||
uint64_t uiA0;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float64_t extF80_to_f64(extFloat80_t a, struct softfloat_status_t *status)
|
||||
float64 extF80_to_f64(extFloat80_t a, struct softfloat_status_t *status)
|
||||
{
|
||||
uint16_t uiA64;
|
||||
uint64_t uiA0;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float32_t f128_to_f32(float128_t a, struct softfloat_status_t *status)
|
||||
float32 f128_to_f32(float128_t a, struct softfloat_status_t *status)
|
||||
{
|
||||
uint64_t uiA64, uiA0;
|
||||
bool sign;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float64_t f128_to_f64(float128_t a, struct softfloat_status_t *status)
|
||||
float64 f128_to_f64(float128_t a, struct softfloat_status_t *status)
|
||||
{
|
||||
uint64_t uiA64, uiA0;
|
||||
bool sign;
|
||||
|
@ -38,10 +38,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
extern float16_t softfloat_addMagsF16(uint16_t, uint16_t, struct softfloat_status_t *);
|
||||
extern float16_t softfloat_subMagsF16(uint16_t, uint16_t, struct softfloat_status_t *);
|
||||
extern float16 softfloat_addMagsF16(uint16_t, uint16_t, struct softfloat_status_t *);
|
||||
extern float16 softfloat_subMagsF16(uint16_t, uint16_t, struct softfloat_status_t *);
|
||||
|
||||
float16_t f16_add(float16_t a, float16_t b, struct softfloat_status_t *status)
|
||||
float16 f16_add(float16 a, float16 b, struct softfloat_status_t *status)
|
||||
{
|
||||
if (signF16UI((uint16_t) a ^ (uint16_t) b)) {
|
||||
return softfloat_subMagsF16(a, b, status);
|
||||
@ -50,7 +50,7 @@ float16_t f16_add(float16_t a, float16_t b, struct softfloat_status_t *status)
|
||||
}
|
||||
}
|
||||
|
||||
float16_t f16_sub(float16_t a, float16_t b, struct softfloat_status_t *status)
|
||||
float16 f16_sub(float16 a, float16 b, struct softfloat_status_t *status)
|
||||
{
|
||||
if (signF16UI((uint16_t) a ^ (uint16_t) b)) {
|
||||
return softfloat_addMagsF16(a, b, status);
|
||||
|
@ -38,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
softfloat_class_t f16_class(float16_t a)
|
||||
softfloat_class_t f16_class(float16 a)
|
||||
{
|
||||
bool signA;
|
||||
int8_t expA;
|
||||
|
@ -46,7 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| value `b', or 'float_relation_unordered' otherwise.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
int f16_compare(float16_t a, float16_t b, bool quiet, struct softfloat_status_t *status)
|
||||
int f16_compare(float16 a, float16 b, bool quiet, struct softfloat_status_t *status)
|
||||
{
|
||||
softfloat_class_t aClass;
|
||||
softfloat_class_t bClass;
|
||||
|
@ -44,7 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
extern const uint16_t softfloat_approxRecip_1k0s[];
|
||||
extern const uint16_t softfloat_approxRecip_1k1s[];
|
||||
|
||||
float16_t f16_div(float16_t a, float16_t b, struct softfloat_status_t *status)
|
||||
float16 f16_div(float16 a, float16 b, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int8_t expA;
|
||||
|
@ -46,7 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float16_t f16_getExp(float16_t a, struct softfloat_status_t *status)
|
||||
float16 f16_getExp(float16 a, struct softfloat_status_t *status)
|
||||
{
|
||||
int8_t expA;
|
||||
uint16_t sigA;
|
||||
@ -57,12 +57,12 @@ float16_t f16_getExp(float16_t a, struct softfloat_status_t *status)
|
||||
|
||||
if (expA == 0x1F) {
|
||||
if (sigA) return softfloat_propagateNaNF16UI(a, 0, status);
|
||||
return packToF32UI(0, 0x1F, 0);
|
||||
return packToF16UI(0, 0x1F, 0);
|
||||
}
|
||||
|
||||
if (! expA) {
|
||||
if (! sigA || softfloat_denormalsAreZeros(status))
|
||||
return packToF32UI(1, 0x1F, 0);
|
||||
return packToF16UI(1, 0x1F, 0);
|
||||
|
||||
softfloat_raiseFlags(status, softfloat_flag_denormal);
|
||||
normExpSig = softfloat_normSubnormalF16Sig(sigA);
|
||||
|
@ -47,7 +47,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| Arithmetic.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float16_t f16_getMant(float16_t a, softfloat_status_t *status, int sign_ctrl, int interv)
|
||||
float16 f16_getMant(float16 a, softfloat_status_t *status, int sign_ctrl, int interv)
|
||||
{
|
||||
bool signA;
|
||||
int8_t expA;
|
||||
|
@ -43,7 +43,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| smaller of them.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float16_t f16_min(float16_t a, float16_t b, struct softfloat_status_t *status)
|
||||
float16 f16_min(float16 a, float16 b, struct softfloat_status_t *status)
|
||||
{
|
||||
if (softfloat_denormalsAreZeros(status)) {
|
||||
a = f16_denormal_to_zero(a);
|
||||
@ -58,7 +58,7 @@ float16_t f16_min(float16_t a, float16_t b, struct softfloat_status_t *status)
|
||||
| larger of them.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float16_t f16_max(float16_t a, float16_t b, struct softfloat_status_t *status)
|
||||
float16 f16_max(float16 a, float16 b, struct softfloat_status_t *status)
|
||||
{
|
||||
if (softfloat_denormalsAreZeros(status)) {
|
||||
a = f16_denormal_to_zero(a);
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float16_t f16_mul(float16_t a, float16_t b, struct softfloat_status_t *status)
|
||||
float16 f16_mul(float16 a, float16 b, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int8_t expA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "softfloat.h"
|
||||
#include "specialize.h"
|
||||
|
||||
float16_t f16_mulAdd(float16_t a, float16_t b, float16_t c, uint8_t op, struct softfloat_status_t *status)
|
||||
float16 f16_mulAdd(float16 a, float16 b, float16 c, uint8_t op, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int8_t expA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float16_t f16_range(float16_t a, float16_t b, bool is_max, bool is_abs, int sign_ctrl, softfloat_status_t *status)
|
||||
float16 f16_range(float16 a, float16 b, bool is_max, bool is_abs, int sign_ctrl, softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int8_t expA;
|
||||
@ -103,7 +103,7 @@ float16_t f16_range(float16_t a, float16_t b, bool is_max, bool is_abs, int sign
|
||||
z = signA ? b : a;
|
||||
}
|
||||
} else {
|
||||
float16_t tmp_a = a, tmp_b = b;
|
||||
float16 tmp_a = a, tmp_b = b;
|
||||
if (is_abs) {
|
||||
tmp_a = tmp_a & ~0x8000; // clear the sign bit
|
||||
tmp_b = tmp_b & ~0x8000;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float16_t f16_roundToInt(float16_t a, uint8_t scale, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
float16 f16_roundToInt(float16 a, uint8_t scale, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int8_t exp;
|
||||
uint16_t frac;
|
||||
|
@ -42,7 +42,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
extern const uint16_t softfloat_approxRecipSqrt_1k0s[];
|
||||
extern const uint16_t softfloat_approxRecipSqrt_1k1s[];
|
||||
|
||||
float16_t f16_sqrt(float16_t a, struct softfloat_status_t *status)
|
||||
float16 f16_sqrt(float16 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int8_t expA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
extFloat80_t f16_to_extF80(float16_t a, struct softfloat_status_t *status)
|
||||
extFloat80_t f16_to_extF80(float16 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int8_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float32_t f16_to_f32(float16_t a, struct softfloat_status_t *status)
|
||||
float32 f16_to_f32(float16 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int8_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float64_t f16_to_f64(float16_t a, struct softfloat_status_t *status)
|
||||
float64 f16_to_f64(float16 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int8_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int32_t f16_to_i32(float16_t a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
int32_t f16_to_i32(float16 a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int8_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int32_t f16_to_i32_r_minMag(float16_t a, bool exact, struct softfloat_status_t *status)
|
||||
int32_t f16_to_i32_r_minMag(float16 a, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int8_t exp;
|
||||
uint16_t frac;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int64_t f16_to_i64(float16_t a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
int64_t f16_to_i64(float16 a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int8_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int64_t f16_to_i64_r_minMag(float16_t a, bool exact, struct softfloat_status_t *status)
|
||||
int64_t f16_to_i64_r_minMag(float16 a, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int8_t exp;
|
||||
uint16_t frac;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint32_t f16_to_ui32(float16_t a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
uint32_t f16_to_ui32(float16 a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int8_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint32_t f16_to_ui32_r_minMag(float16_t a, bool exact, struct softfloat_status_t *status)
|
||||
uint32_t f16_to_ui32_r_minMag(float16 a, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int8_t exp;
|
||||
uint16_t frac;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint64_t f16_to_ui64(float16_t a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
uint64_t f16_to_ui64(float16 a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int8_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint64_t f16_to_ui64_r_minMag(float16_t a, bool exact, struct softfloat_status_t *status)
|
||||
uint64_t f16_to_ui64_r_minMag(float16 a, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int8_t exp;
|
||||
uint16_t frac;
|
||||
|
@ -38,10 +38,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
extern float32_t softfloat_addMagsF32(uint32_t, uint32_t, struct softfloat_status_t *);
|
||||
extern float32_t softfloat_subMagsF32(uint32_t, uint32_t, struct softfloat_status_t *);
|
||||
extern float32 softfloat_addMagsF32(uint32_t, uint32_t, struct softfloat_status_t *);
|
||||
extern float32 softfloat_subMagsF32(uint32_t, uint32_t, struct softfloat_status_t *);
|
||||
|
||||
float32_t f32_add(float32_t a, float32_t b, struct softfloat_status_t *status)
|
||||
float32 f32_add(float32 a, float32 b, struct softfloat_status_t *status)
|
||||
{
|
||||
if (signF32UI((uint32_t) a ^ (uint32_t) b)) {
|
||||
return softfloat_subMagsF32(a, b, status);
|
||||
@ -50,7 +50,7 @@ float32_t f32_add(float32_t a, float32_t b, struct softfloat_status_t *status)
|
||||
}
|
||||
}
|
||||
|
||||
float32_t f32_sub(float32_t a, float32_t b, struct softfloat_status_t *status)
|
||||
float32 f32_sub(float32 a, float32 b, struct softfloat_status_t *status)
|
||||
{
|
||||
if (signF32UI((uint32_t) a ^ (uint32_t) b)) {
|
||||
return softfloat_addMagsF32(a, b, status);
|
||||
|
@ -38,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
softfloat_class_t f32_class(float32_t a)
|
||||
softfloat_class_t f32_class(float32 a)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -46,7 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| value `b', or 'float_relation_unordered' otherwise.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
int f32_compare(float32_t a, float32_t b, bool quiet, struct softfloat_status_t *status)
|
||||
int f32_compare(float32 a, float32 b, bool quiet, struct softfloat_status_t *status)
|
||||
{
|
||||
softfloat_class_t aClass;
|
||||
softfloat_class_t bClass;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float32_t f32_div(float32_t a, float32_t b, struct softfloat_status_t *status)
|
||||
float32 f32_div(float32 a, float32 b, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -46,7 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float32_t f32_frc(float32_t a, softfloat_status_t *status)
|
||||
float32 f32_frc(float32 a, softfloat_status_t *status)
|
||||
{
|
||||
int roundingMode = softfloat_getRoundingMode(status);
|
||||
|
||||
|
@ -46,7 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float32_t f32_getExp(float32_t a, struct softfloat_status_t *status)
|
||||
float32 f32_getExp(float32 a, struct softfloat_status_t *status)
|
||||
{
|
||||
int16_t expA;
|
||||
uint32_t sigA;
|
||||
|
@ -47,7 +47,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| Arithmetic.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float32_t f32_getMant(float32_t a, softfloat_status_t *status, int sign_ctrl, int interv)
|
||||
float32 f32_getMant(float32 a, softfloat_status_t *status, int sign_ctrl, int interv)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -43,7 +43,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| smaller of them.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float32_t f32_min(float32_t a, float32_t b, struct softfloat_status_t *status)
|
||||
float32 f32_min(float32 a, float32 b, struct softfloat_status_t *status)
|
||||
{
|
||||
if (softfloat_denormalsAreZeros(status)) {
|
||||
a = f32_denormal_to_zero(a);
|
||||
@ -58,7 +58,7 @@ float32_t f32_min(float32_t a, float32_t b, struct softfloat_status_t *status)
|
||||
| larger of them.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float32_t f32_max(float32_t a, float32_t b, struct softfloat_status_t *status)
|
||||
float32 f32_max(float32 a, float32 b, struct softfloat_status_t *status)
|
||||
{
|
||||
if (softfloat_denormalsAreZeros(status)) {
|
||||
a = f32_denormal_to_zero(a);
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float32_t f32_mul(float32_t a, float32_t b, struct softfloat_status_t *status)
|
||||
float32 f32_mul(float32 a, float32 b, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "softfloat.h"
|
||||
#include "specialize.h"
|
||||
|
||||
float32_t f32_mulAdd(float32_t a, float32_t b, float32_t c, uint8_t op, struct softfloat_status_t *status)
|
||||
float32 f32_mulAdd(float32 a, float32 b, float32 c, uint8_t op, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float32_t f32_range(float32_t a, float32_t b, bool is_max, bool is_abs, int sign_ctrl, softfloat_status_t *status)
|
||||
float32 f32_range(float32 a, float32 b, bool is_max, bool is_abs, int sign_ctrl, softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
@ -103,7 +103,7 @@ float32_t f32_range(float32_t a, float32_t b, bool is_max, bool is_abs, int sign
|
||||
z = signA ? b : a;
|
||||
}
|
||||
} else {
|
||||
float32_t tmp_a = a, tmp_b = b;
|
||||
float32 tmp_a = a, tmp_b = b;
|
||||
if (is_abs) {
|
||||
tmp_a = tmp_a & ~0x80000000; // clear the sign bit
|
||||
tmp_b = tmp_b & ~0x80000000;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float32_t f32_roundToInt(float32_t a, uint8_t scale, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
float32 f32_roundToInt(float32 a, uint8_t scale, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int16_t exp;
|
||||
int32_t frac;
|
||||
|
@ -49,7 +49,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float32_t f32_scalef(float32_t a, float32_t b, struct softfloat_status_t *status)
|
||||
float32 f32_scalef(float32 a, float32 b, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float32_t f32_sqrt(float32_t a, struct softfloat_status_t *status)
|
||||
float32 f32_sqrt(float32 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
extFloat80_t f32_to_extF80(float32_t a, struct softfloat_status_t *status)
|
||||
extFloat80_t f32_to_extF80(float32 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float128_t f32_to_f128(float32_t a, struct softfloat_status_t *status)
|
||||
float128_t f32_to_f128(float32 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float16_t f32_to_f16(float32_t a, struct softfloat_status_t *status)
|
||||
float16 f32_to_f16(float32 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float64_t f32_to_f64(float32_t a, struct softfloat_status_t *status)
|
||||
float64 f32_to_f64(float32 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int32_t f32_to_i32(float32_t a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
int32_t f32_to_i32(float32 a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int32_t f32_to_i32_r_minMag(float32_t a, bool exact, struct softfloat_status_t *status)
|
||||
int32_t f32_to_i32_r_minMag(float32 a, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int16_t exp;
|
||||
uint32_t sig;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int64_t f32_to_i64(float32_t a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
int64_t f32_to_i64(float32 a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int64_t f32_to_i64_r_minMag(float32_t a, bool exact, struct softfloat_status_t *status)
|
||||
int64_t f32_to_i64_r_minMag(float32 a, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int16_t exp;
|
||||
uint32_t sig;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint32_t f32_to_ui32(float32_t a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
uint32_t f32_to_ui32(float32 a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint32_t f32_to_ui32_r_minMag(float32_t a, bool exact, struct softfloat_status_t *status)
|
||||
uint32_t f32_to_ui32_r_minMag(float32 a, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int16_t exp;
|
||||
uint32_t sig;
|
||||
|
@ -41,7 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint64_t f32_to_ui64(float32_t a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
uint64_t f32_to_ui64(float32 a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint64_t f32_to_ui64_r_minMag(float32_t a, bool exact, struct softfloat_status_t *status)
|
||||
uint64_t f32_to_ui64_r_minMag(float32 a, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int16_t exp;
|
||||
uint32_t sig;
|
||||
|
@ -38,10 +38,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
extern float64_t softfloat_addMagsF64(uint64_t, uint64_t, bool, struct softfloat_status_t *);
|
||||
extern float64_t softfloat_subMagsF64(uint64_t, uint64_t, bool, struct softfloat_status_t *);
|
||||
extern float64 softfloat_addMagsF64(uint64_t, uint64_t, bool, struct softfloat_status_t *);
|
||||
extern float64 softfloat_subMagsF64(uint64_t, uint64_t, bool, struct softfloat_status_t *);
|
||||
|
||||
float64_t f64_add(float64_t a, float64_t b, struct softfloat_status_t *status)
|
||||
float64 f64_add(float64 a, float64 b, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
bool signB;
|
||||
@ -55,7 +55,7 @@ float64_t f64_add(float64_t a, float64_t b, struct softfloat_status_t *status)
|
||||
}
|
||||
}
|
||||
|
||||
float64_t f64_sub(float64_t a, float64_t b, struct softfloat_status_t *status)
|
||||
float64 f64_sub(float64 a, float64 b, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
bool signB;
|
||||
|
@ -38,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
softfloat_class_t f64_class(float64_t a)
|
||||
softfloat_class_t f64_class(float64 a)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -46,7 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| value `b', or 'float_relation_unordered' otherwise.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
int f64_compare(float64_t a, float64_t b, bool quiet, struct softfloat_status_t *status)
|
||||
int f64_compare(float64 a, float64 b, bool quiet, struct softfloat_status_t *status)
|
||||
{
|
||||
softfloat_class_t aClass;
|
||||
softfloat_class_t bClass;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float64_t f64_div(float64_t a, float64_t b, struct softfloat_status_t *status)
|
||||
float64 f64_div(float64 a, float64 b, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -46,7 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float64_t f64_frc(float64_t a, softfloat_status_t *status)
|
||||
float64 f64_frc(float64 a, softfloat_status_t *status)
|
||||
{
|
||||
int roundingMode = softfloat_getRoundingMode(status);
|
||||
|
||||
|
@ -46,7 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float64_t f64_getExp(float64_t a, struct softfloat_status_t *status)
|
||||
float64 f64_getExp(float64 a, struct softfloat_status_t *status)
|
||||
{
|
||||
int16_t expA;
|
||||
uint64_t sigA;
|
||||
|
@ -47,7 +47,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| Arithmetic.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float64_t f64_getMant(float64_t a, softfloat_status_t *status, int sign_ctrl, int interv)
|
||||
float64 f64_getMant(float64 a, softfloat_status_t *status, int sign_ctrl, int interv)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -43,7 +43,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| smaller of them.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float64_t f64_min(float64_t a, float64_t b, struct softfloat_status_t *status)
|
||||
float64 f64_min(float64 a, float64 b, struct softfloat_status_t *status)
|
||||
{
|
||||
if (softfloat_denormalsAreZeros(status)) {
|
||||
a = f64_denormal_to_zero(a);
|
||||
@ -58,7 +58,7 @@ float64_t f64_min(float64_t a, float64_t b, struct softfloat_status_t *status)
|
||||
| larger of them.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float64_t f64_max(float64_t a, float64_t b, struct softfloat_status_t *status)
|
||||
float64 f64_max(float64 a, float64 b, struct softfloat_status_t *status)
|
||||
{
|
||||
if (softfloat_denormalsAreZeros(status)) {
|
||||
a = f64_denormal_to_zero(a);
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float64_t f64_mul(float64_t a, float64_t b, struct softfloat_status_t *status)
|
||||
float64 f64_mul(float64 a, float64 b, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "softfloat.h"
|
||||
#include "specialize.h"
|
||||
|
||||
float64_t f64_mulAdd(float64_t a, float64_t b, float64_t c, uint8_t op, struct softfloat_status_t *status)
|
||||
float64 f64_mulAdd(float64 a, float64 b, float64 c, uint8_t op, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float64_t f64_range(float64_t a, float64_t b, bool is_max, bool is_abs, int sign_ctrl, softfloat_status_t *status)
|
||||
float64 f64_range(float64 a, float64 b, bool is_max, bool is_abs, int sign_ctrl, softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
@ -103,7 +103,7 @@ float64_t f64_range(float64_t a, float64_t b, bool is_max, bool is_abs, int sign
|
||||
z = signA ? b : a;
|
||||
}
|
||||
} else {
|
||||
float64_t tmp_a = a, tmp_b = b;
|
||||
float64 tmp_a = a, tmp_b = b;
|
||||
if (is_abs) {
|
||||
tmp_a = tmp_a & ~UINT64_C(0x8000000000000000); // clear the sign bit
|
||||
tmp_b = tmp_b & ~UINT64_C(0x8000000000000000);
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float64_t f64_roundToInt(float64_t a, uint8_t scale, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
float64 f64_roundToInt(float64 a, uint8_t scale, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int16_t exp;
|
||||
int64_t frac;
|
||||
|
@ -49,7 +49,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
| IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
float64_t f64_scalef(float64_t a, float64_t b, struct softfloat_status_t *status)
|
||||
float64 f64_scalef(float64 a, float64 b, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float64_t f64_sqrt(float64_t a, struct softfloat_status_t *status)
|
||||
float64 f64_sqrt(float64 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool signA;
|
||||
int16_t expA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
extFloat80_t f64_to_extF80(float64_t a, struct softfloat_status_t *status)
|
||||
extFloat80_t f64_to_extF80(float64 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float128_t f64_to_f128(float64_t a, struct softfloat_status_t *status)
|
||||
float128_t f64_to_f128(float64 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float16_t f64_to_f16(float64_t a, struct softfloat_status_t *status)
|
||||
float16 f64_to_f16(float64 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float32_t f64_to_f32(float64_t a, struct softfloat_status_t *status)
|
||||
float32 f64_to_f32(float64 a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int32_t f64_to_i32(float64_t a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
int32_t f64_to_i32(float64 a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int32_t f64_to_i32_r_minMag(float64_t a, bool exact, struct softfloat_status_t *status)
|
||||
int32_t f64_to_i32_r_minMag(float64 a, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int16_t exp;
|
||||
uint64_t sig;
|
||||
|
@ -41,7 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int64_t f64_to_i64(float64_t a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
int64_t f64_to_i64(float64 a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
int64_t f64_to_i64_r_minMag(float64_t a, bool exact, struct softfloat_status_t *status)
|
||||
int64_t f64_to_i64_r_minMag(float64 a, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -41,7 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint32_t f64_to_ui32(float64_t a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
uint32_t f64_to_ui32(float64 a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint32_t f64_to_ui32_r_minMag(float64_t a, bool exact, struct softfloat_status_t *status)
|
||||
uint32_t f64_to_ui32_r_minMag(float64 a, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int16_t exp;
|
||||
uint64_t sig;
|
||||
|
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint64_t f64_to_ui64(float64_t a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
uint64_t f64_to_ui64(float64 a, uint8_t roundingMode, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
int16_t exp;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
uint64_t f64_to_ui64_r_minMag(float64_t a, bool exact, struct softfloat_status_t *status)
|
||||
uint64_t f64_to_ui64_r_minMag(float64 a, bool exact, struct softfloat_status_t *status)
|
||||
{
|
||||
int16_t exp;
|
||||
uint64_t sig;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "primitives.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float16_t i32_to_f16(int32_t a, struct softfloat_status_t *status)
|
||||
float16 i32_to_f16(int32_t a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
uint32_t absA;
|
||||
|
@ -38,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "internals.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float32_t i32_to_f32(int32_t a, struct softfloat_status_t *status)
|
||||
float32 i32_to_f32(int32_t a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
uint32_t absA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "primitives.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float64_t i32_to_f64(int32_t a)
|
||||
float64 i32_to_f64(int32_t a)
|
||||
{
|
||||
bool sign;
|
||||
uint32_t absA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "primitives.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float16_t i64_to_f16(int64_t a, struct softfloat_status_t *status)
|
||||
float16 i64_to_f16(int64_t a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
uint64_t absA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "primitives.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float32_t i64_to_f32(int64_t a, struct softfloat_status_t *status)
|
||||
float32 i64_to_f32(int64_t a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
uint64_t absA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "primitives.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float64_t i64_to_f64(int64_t a, struct softfloat_status_t *status)
|
||||
float64 i64_to_f64(int64_t a, struct softfloat_status_t *status)
|
||||
{
|
||||
bool sign;
|
||||
uint64_t absA;
|
||||
|
@ -63,23 +63,23 @@ int64_t softfloat_roundToI64(bool, uint64_t, uint64_t, uint8_t, bool, struct sof
|
||||
struct exp8_sig16 { int8_t exp; uint16_t sig; };
|
||||
struct exp8_sig16 softfloat_normSubnormalF16Sig(uint16_t);
|
||||
|
||||
float16_t softfloat_roundPackToF16(bool, int16_t, uint16_t, struct softfloat_status_t *);
|
||||
float16_t softfloat_normRoundPackToF16(bool, int16_t, uint16_t, struct softfloat_status_t *);
|
||||
float16 softfloat_roundPackToF16(bool, int16_t, uint16_t, struct softfloat_status_t *);
|
||||
float16 softfloat_normRoundPackToF16(bool, int16_t, uint16_t, struct softfloat_status_t *);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define signF32UI(a) ((bool) ((uint32_t) (a)>>31))
|
||||
#define expF32UI(a) ((int16_t) ((a)>>23) & 0xFF)
|
||||
#define fracF32UI(a) ((a) & 0x007FFFFF)
|
||||
#define packToF32UI(sign, exp, sig) (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<23) + (sig))
|
||||
#define packToF32UI(sign, exp, sig) (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<23) + (uint32_t)(sig))
|
||||
|
||||
#define isNaNF32UI(a) (((~(a) & 0x7F800000) == 0) && ((a) & 0x007FFFFF))
|
||||
|
||||
struct exp16_sig32 { int16_t exp; uint32_t sig; };
|
||||
struct exp16_sig32 softfloat_normSubnormalF32Sig(uint32_t);
|
||||
|
||||
float32_t softfloat_roundPackToF32(bool, int16_t, uint32_t, struct softfloat_status_t *);
|
||||
float32_t softfloat_normRoundPackToF32(bool, int16_t, uint32_t, struct softfloat_status_t *);
|
||||
float32 softfloat_roundPackToF32(bool, int16_t, uint32_t, struct softfloat_status_t *);
|
||||
float32 softfloat_normRoundPackToF32(bool, int16_t, uint32_t, struct softfloat_status_t *);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
*----------------------------------------------------------------------------*/
|
||||
@ -93,8 +93,8 @@ float32_t softfloat_normRoundPackToF32(bool, int16_t, uint32_t, struct softfloat
|
||||
struct exp16_sig64 { int16_t exp; uint64_t sig; };
|
||||
struct exp16_sig64 softfloat_normSubnormalF64Sig(uint64_t);
|
||||
|
||||
float64_t softfloat_roundPackToF64(bool, int16_t, uint64_t, struct softfloat_status_t *);
|
||||
float64_t softfloat_normRoundPackToF64(bool, int16_t, uint64_t, struct softfloat_status_t *);
|
||||
float64 softfloat_roundPackToF64(bool, int16_t, uint64_t, struct softfloat_status_t *);
|
||||
float64 softfloat_normRoundPackToF64(bool, int16_t, uint64_t, struct softfloat_status_t *);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
@ -40,227 +40,227 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// ======= float16 ======= //
|
||||
|
||||
typedef int (*float16_compare_method)(float16_t, float16_t, softfloat_status_t *status);
|
||||
typedef int (*float16_compare_method)(float16, float16, softfloat_status_t *status);
|
||||
|
||||
// 0x00
|
||||
BX_CPP_INLINE int f16_eq_ordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_eq_ordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x01
|
||||
BX_CPP_INLINE int f16_lt_ordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_lt_ordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation == softfloat_relation_less);
|
||||
}
|
||||
|
||||
// 0x02
|
||||
BX_CPP_INLINE int f16_le_ordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_le_ordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation == softfloat_relation_less) || (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x03
|
||||
BX_CPP_INLINE int f16_unordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_unordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x04
|
||||
BX_CPP_INLINE int f16_neq_unordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_neq_unordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x05
|
||||
BX_CPP_INLINE int f16_nlt_unordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_nlt_unordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation != softfloat_relation_less);
|
||||
}
|
||||
|
||||
// 0x06
|
||||
BX_CPP_INLINE int f16_nle_unordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_nle_unordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation != softfloat_relation_less) && (relation != softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x07
|
||||
BX_CPP_INLINE int f16_ordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_ordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x08
|
||||
BX_CPP_INLINE int f16_eq_unordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_eq_unordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_equal) || (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x09
|
||||
BX_CPP_INLINE int f16_nge_unordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_nge_unordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation == softfloat_relation_less) || (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x0a
|
||||
BX_CPP_INLINE int f16_ngt_unordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_ngt_unordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation != softfloat_relation_greater);
|
||||
}
|
||||
|
||||
// 0x0b
|
||||
BX_CPP_INLINE int f16_false_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_false_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
f16_compare_quiet(a, b, status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 0x0c
|
||||
BX_CPP_INLINE int f16_neq_ordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_neq_ordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_equal) && (relation != softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x0d
|
||||
BX_CPP_INLINE int f16_ge_ordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_ge_ordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation == softfloat_relation_greater) || (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x0e
|
||||
BX_CPP_INLINE int f16_gt_ordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_gt_ordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation == softfloat_relation_greater);
|
||||
}
|
||||
|
||||
// 0x0f
|
||||
BX_CPP_INLINE int f16_true_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_true_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
f16_compare_quiet(a, b, status);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 0x10
|
||||
BX_CPP_INLINE int f16_eq_ordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_eq_ordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x11
|
||||
BX_CPP_INLINE int f16_lt_ordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_lt_ordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_less);
|
||||
}
|
||||
|
||||
// 0x12
|
||||
BX_CPP_INLINE int f16_le_ordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_le_ordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_less) || (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x13
|
||||
BX_CPP_INLINE int f16_unordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_unordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x14
|
||||
BX_CPP_INLINE int f16_neq_unordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_neq_unordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation != softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x15
|
||||
BX_CPP_INLINE int f16_nlt_unordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_nlt_unordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_less);
|
||||
}
|
||||
|
||||
// 0x16
|
||||
BX_CPP_INLINE int f16_nle_unordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_nle_unordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_less) && (relation != softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x17
|
||||
BX_CPP_INLINE int f16_ordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_ordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation != softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x18
|
||||
BX_CPP_INLINE int f16_eq_unordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_eq_unordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation == softfloat_relation_equal) || (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x19
|
||||
BX_CPP_INLINE int f16_nge_unordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_nge_unordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_less) || (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x1a
|
||||
BX_CPP_INLINE int f16_ngt_unordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_ngt_unordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_greater);
|
||||
}
|
||||
|
||||
// 0x1b
|
||||
BX_CPP_INLINE int f16_false_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_false_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
f16_compare(a, b, status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 0x1c
|
||||
BX_CPP_INLINE int f16_neq_ordered_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_neq_ordered_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare(a, b, status);
|
||||
return (relation != softfloat_relation_equal) && (relation != softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x1d
|
||||
BX_CPP_INLINE int f16_ge_ordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_ge_ordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_greater) || (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x1e
|
||||
BX_CPP_INLINE int f16_gt_ordered_quiet(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_gt_ordered_quiet(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f16_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_greater);
|
||||
}
|
||||
|
||||
// 0x1f
|
||||
BX_CPP_INLINE int f16_true_signalling(float16_t a, float16_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f16_true_signalling(float16 a, float16 b, softfloat_status_t *status)
|
||||
{
|
||||
f16_compare(a, b, status);
|
||||
return 1;
|
||||
@ -268,227 +268,227 @@ BX_CPP_INLINE int f16_true_signalling(float16_t a, float16_t b, softfloat_status
|
||||
|
||||
// ======= float32 ======= //
|
||||
|
||||
typedef int (*float32_compare_method)(float32_t, float32_t, softfloat_status_t *status);
|
||||
typedef int (*float32_compare_method)(float32, float32, softfloat_status_t *status);
|
||||
|
||||
// 0x00
|
||||
BX_CPP_INLINE int f32_eq_ordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_eq_ordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x01
|
||||
BX_CPP_INLINE int f32_lt_ordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_lt_ordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation == softfloat_relation_less);
|
||||
}
|
||||
|
||||
// 0x02
|
||||
BX_CPP_INLINE int f32_le_ordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_le_ordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation == softfloat_relation_less) || (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x03
|
||||
BX_CPP_INLINE int f32_unordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_unordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x04
|
||||
BX_CPP_INLINE int f32_neq_unordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_neq_unordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x05
|
||||
BX_CPP_INLINE int f32_nlt_unordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_nlt_unordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation != softfloat_relation_less);
|
||||
}
|
||||
|
||||
// 0x06
|
||||
BX_CPP_INLINE int f32_nle_unordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_nle_unordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation != softfloat_relation_less) && (relation != softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x07
|
||||
BX_CPP_INLINE int f32_ordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_ordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x08
|
||||
BX_CPP_INLINE int f32_eq_unordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_eq_unordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_equal) || (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x09
|
||||
BX_CPP_INLINE int f32_nge_unordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_nge_unordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation == softfloat_relation_less) || (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x0a
|
||||
BX_CPP_INLINE int f32_ngt_unordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_ngt_unordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation != softfloat_relation_greater);
|
||||
}
|
||||
|
||||
// 0x0b
|
||||
BX_CPP_INLINE int f32_false_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_false_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
f32_compare_quiet(a, b, status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 0x0c
|
||||
BX_CPP_INLINE int f32_neq_ordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_neq_ordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_equal) && (relation != softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x0d
|
||||
BX_CPP_INLINE int f32_ge_ordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_ge_ordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation == softfloat_relation_greater) || (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x0e
|
||||
BX_CPP_INLINE int f32_gt_ordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_gt_ordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation == softfloat_relation_greater);
|
||||
}
|
||||
|
||||
// 0x0f
|
||||
BX_CPP_INLINE int f32_true_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_true_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
f32_compare_quiet(a, b, status);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 0x10
|
||||
BX_CPP_INLINE int f32_eq_ordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_eq_ordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x11
|
||||
BX_CPP_INLINE int f32_lt_ordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_lt_ordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_less);
|
||||
}
|
||||
|
||||
// 0x12
|
||||
BX_CPP_INLINE int f32_le_ordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_le_ordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_less) || (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x13
|
||||
BX_CPP_INLINE int f32_unordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_unordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x14
|
||||
BX_CPP_INLINE int f32_neq_unordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_neq_unordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation != softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x15
|
||||
BX_CPP_INLINE int f32_nlt_unordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_nlt_unordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_less);
|
||||
}
|
||||
|
||||
// 0x16
|
||||
BX_CPP_INLINE int f32_nle_unordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_nle_unordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_less) && (relation != softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x17
|
||||
BX_CPP_INLINE int f32_ordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_ordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation != softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x18
|
||||
BX_CPP_INLINE int f32_eq_unordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_eq_unordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation == softfloat_relation_equal) || (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x19
|
||||
BX_CPP_INLINE int f32_nge_unordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_nge_unordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_less) || (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x1a
|
||||
BX_CPP_INLINE int f32_ngt_unordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_ngt_unordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_greater);
|
||||
}
|
||||
|
||||
// 0x1b
|
||||
BX_CPP_INLINE int f32_false_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_false_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
f32_compare(a, b, status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 0x1c
|
||||
BX_CPP_INLINE int f32_neq_ordered_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_neq_ordered_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare(a, b, status);
|
||||
return (relation != softfloat_relation_equal) && (relation != softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x1d
|
||||
BX_CPP_INLINE int f32_ge_ordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_ge_ordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_greater) || (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x1e
|
||||
BX_CPP_INLINE int f32_gt_ordered_quiet(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_gt_ordered_quiet(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f32_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_greater);
|
||||
}
|
||||
|
||||
// 0x1f
|
||||
BX_CPP_INLINE int f32_true_signalling(float32_t a, float32_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f32_true_signalling(float32 a, float32 b, softfloat_status_t *status)
|
||||
{
|
||||
f32_compare(a, b, status);
|
||||
return 1;
|
||||
@ -496,227 +496,227 @@ BX_CPP_INLINE int f32_true_signalling(float32_t a, float32_t b, softfloat_status
|
||||
|
||||
// ======= float64 ======= //
|
||||
|
||||
typedef int (*float64_compare_method)(float64_t, float64_t, softfloat_status_t *status);
|
||||
typedef int (*float64_compare_method)(float64, float64, softfloat_status_t *status);
|
||||
|
||||
// 0x00
|
||||
BX_CPP_INLINE int f64_eq_ordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_eq_ordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x01
|
||||
BX_CPP_INLINE int f64_lt_ordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_lt_ordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation == softfloat_relation_less);
|
||||
}
|
||||
|
||||
// 0x02
|
||||
BX_CPP_INLINE int f64_le_ordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_le_ordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation == softfloat_relation_less) || (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x03
|
||||
BX_CPP_INLINE int f64_unordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_unordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x04
|
||||
BX_CPP_INLINE int f64_neq_unordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_neq_unordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x05
|
||||
BX_CPP_INLINE int f64_nlt_unordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_nlt_unordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation != softfloat_relation_less);
|
||||
}
|
||||
|
||||
// 0x06
|
||||
BX_CPP_INLINE int f64_nle_unordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_nle_unordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation != softfloat_relation_less) && (relation != softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x07
|
||||
BX_CPP_INLINE int f64_ordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_ordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x08
|
||||
BX_CPP_INLINE int f64_eq_unordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_eq_unordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_equal) || (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x09
|
||||
BX_CPP_INLINE int f64_nge_unordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_nge_unordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation == softfloat_relation_less) || (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x0a
|
||||
BX_CPP_INLINE int f64_ngt_unordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_ngt_unordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation != softfloat_relation_greater);
|
||||
}
|
||||
|
||||
// 0x0b
|
||||
BX_CPP_INLINE int f64_false_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_false_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
f64_compare_quiet(a, b, status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 0x0c
|
||||
BX_CPP_INLINE int f64_neq_ordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_neq_ordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_equal) && (relation != softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x0d
|
||||
BX_CPP_INLINE int f64_ge_ordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_ge_ordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation == softfloat_relation_greater) || (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x0e
|
||||
BX_CPP_INLINE int f64_gt_ordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_gt_ordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation == softfloat_relation_greater);
|
||||
}
|
||||
|
||||
// 0x0f
|
||||
BX_CPP_INLINE int f64_true_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_true_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
f64_compare_quiet(a, b, status);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 0x10
|
||||
BX_CPP_INLINE int f64_eq_ordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_eq_ordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x11
|
||||
BX_CPP_INLINE int f64_lt_ordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_lt_ordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_less);
|
||||
}
|
||||
|
||||
// 0x12
|
||||
BX_CPP_INLINE int f64_le_ordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_le_ordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_less) || (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x13
|
||||
BX_CPP_INLINE int f64_unordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_unordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x14
|
||||
BX_CPP_INLINE int f64_neq_unordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_neq_unordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation != softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x15
|
||||
BX_CPP_INLINE int f64_nlt_unordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_nlt_unordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_less);
|
||||
}
|
||||
|
||||
// 0x16
|
||||
BX_CPP_INLINE int f64_nle_unordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_nle_unordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_less) && (relation != softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x17
|
||||
BX_CPP_INLINE int f64_ordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_ordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation != softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x18
|
||||
BX_CPP_INLINE int f64_eq_unordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_eq_unordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation == softfloat_relation_equal) || (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x19
|
||||
BX_CPP_INLINE int f64_nge_unordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_nge_unordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_less) || (relation == softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x1a
|
||||
BX_CPP_INLINE int f64_ngt_unordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_ngt_unordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation != softfloat_relation_greater);
|
||||
}
|
||||
|
||||
// 0x1b
|
||||
BX_CPP_INLINE int f64_false_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_false_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
f64_compare(a, b, status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 0x1c
|
||||
BX_CPP_INLINE int f64_neq_ordered_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_neq_ordered_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare(a, b, status);
|
||||
return (relation != softfloat_relation_equal) && (relation != softfloat_relation_unordered);
|
||||
}
|
||||
|
||||
// 0x1d
|
||||
BX_CPP_INLINE int f64_ge_ordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_ge_ordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_greater) || (relation == softfloat_relation_equal);
|
||||
}
|
||||
|
||||
// 0x1e
|
||||
BX_CPP_INLINE int f64_gt_ordered_quiet(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_gt_ordered_quiet(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
int relation = f64_compare_quiet(a, b, status);
|
||||
return (relation == softfloat_relation_greater);
|
||||
}
|
||||
|
||||
// 0x1f
|
||||
BX_CPP_INLINE int f64_true_signalling(float64_t a, float64_t b, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int f64_true_signalling(float64 a, float64 b, softfloat_status_t *status)
|
||||
{
|
||||
f64_compare(a, b, status);
|
||||
return 1;
|
||||
|
@ -40,22 +40,22 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// ======= float16 ======= //
|
||||
|
||||
BX_CPP_INLINE bool f16_sign(float16_t a)
|
||||
BX_CPP_INLINE bool f16_sign(float16 a)
|
||||
{
|
||||
return signF16UI(a);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int8_t f16_exp(float16_t a)
|
||||
BX_CPP_INLINE int8_t f16_exp(float16 a)
|
||||
{
|
||||
return expF16UI(a);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE uint16_t f16_fraction(float16_t a)
|
||||
BX_CPP_INLINE uint16_t f16_fraction(float16 a)
|
||||
{
|
||||
return fracF16UI(a);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE float16_t f16_denormal_to_zero(float16_t a)
|
||||
BX_CPP_INLINE float16 f16_denormal_to_zero(float16 a)
|
||||
{
|
||||
if (! expF16UI(a) && fracF16UI(a))
|
||||
return a & 0x8000;
|
||||
@ -64,22 +64,22 @@ BX_CPP_INLINE float16_t f16_denormal_to_zero(float16_t a)
|
||||
|
||||
// ======= float32 ======= //
|
||||
|
||||
BX_CPP_INLINE bool f32_sign(float32_t a)
|
||||
BX_CPP_INLINE bool f32_sign(float32 a)
|
||||
{
|
||||
return signF32UI(a);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int16_t f32_exp(float32_t a)
|
||||
BX_CPP_INLINE int16_t f32_exp(float32 a)
|
||||
{
|
||||
return expF32UI(a);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE uint32_t f32_fraction(float32_t a)
|
||||
BX_CPP_INLINE uint32_t f32_fraction(float32 a)
|
||||
{
|
||||
return fracF32UI(a);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE float32_t f32_denormal_to_zero(float32_t a)
|
||||
BX_CPP_INLINE float32 f32_denormal_to_zero(float32 a)
|
||||
{
|
||||
if (! expF32UI(a) && fracF32UI(a))
|
||||
return a & 0x80000000;
|
||||
@ -88,22 +88,22 @@ BX_CPP_INLINE float32_t f32_denormal_to_zero(float32_t a)
|
||||
|
||||
// ======= float64 ======= //
|
||||
|
||||
BX_CPP_INLINE bool f64_sign(float64_t a)
|
||||
BX_CPP_INLINE bool f64_sign(float64 a)
|
||||
{
|
||||
return signF64UI(a);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int16_t f64_exp(float64_t a)
|
||||
BX_CPP_INLINE int16_t f64_exp(float64 a)
|
||||
{
|
||||
return expF64UI(a);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE uint64_t f64_fraction(float64_t a)
|
||||
BX_CPP_INLINE uint64_t f64_fraction(float64 a)
|
||||
{
|
||||
return fracF64UI(a);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE float64_t f64_denormal_to_zero(float64_t a)
|
||||
BX_CPP_INLINE float64 f64_denormal_to_zero(float64 a)
|
||||
{
|
||||
if (! expF64UI(a) && fracF64UI(a))
|
||||
return a & ((uint64_t)(1) << 63);
|
||||
|
@ -210,97 +210,97 @@ BX_CPP_INLINE void softfloat_setRoundingUp(struct softfloat_status_t *status) {
|
||||
/*----------------------------------------------------------------------------
|
||||
| Integer-to-floating-point conversion routines.
|
||||
*----------------------------------------------------------------------------*/
|
||||
float16_t ui16_to_f16(uint16_t, struct softfloat_status_t *);
|
||||
float16_t ui32_to_f16(uint32_t, struct softfloat_status_t *);
|
||||
float32_t ui32_to_f32(uint32_t, struct softfloat_status_t *);
|
||||
float64_t ui32_to_f64(uint32_t);
|
||||
float16 ui16_to_f16(uint16_t, struct softfloat_status_t *);
|
||||
float16 ui32_to_f16(uint32_t, struct softfloat_status_t *);
|
||||
float32 ui32_to_f32(uint32_t, struct softfloat_status_t *);
|
||||
float64 ui32_to_f64(uint32_t);
|
||||
extFloat80_t ui32_to_extF80(uint32_t);
|
||||
float128_t ui32_to_f128(uint32_t);
|
||||
float16_t ui64_to_f16(uint64_t, struct softfloat_status_t *);
|
||||
float32_t ui64_to_f32(uint64_t, struct softfloat_status_t *);
|
||||
float64_t ui64_to_f64(uint64_t, struct softfloat_status_t *);
|
||||
float16 ui64_to_f16(uint64_t, struct softfloat_status_t *);
|
||||
float32 ui64_to_f32(uint64_t, struct softfloat_status_t *);
|
||||
float64 ui64_to_f64(uint64_t, struct softfloat_status_t *);
|
||||
extFloat80_t ui64_to_extF80(uint64_t);
|
||||
float128_t ui64_to_f128(uint64_t);
|
||||
float16_t i16_to_f16(int16_t, struct softfloat_status_t *);
|
||||
float16_t i32_to_f16(int32_t, struct softfloat_status_t *);
|
||||
float32_t i32_to_f32(int32_t, struct softfloat_status_t *);
|
||||
float64_t i32_to_f64(int32_t);
|
||||
float16 i16_to_f16(int16_t, struct softfloat_status_t *);
|
||||
float16 i32_to_f16(int32_t, struct softfloat_status_t *);
|
||||
float32 i32_to_f32(int32_t, struct softfloat_status_t *);
|
||||
float64 i32_to_f64(int32_t);
|
||||
extFloat80_t i32_to_extF80(int32_t);
|
||||
float128_t i32_to_f128(int32_t);
|
||||
float16_t i64_to_f16(int64_t, struct softfloat_status_t *);
|
||||
float32_t i64_to_f32(int64_t, struct softfloat_status_t *);
|
||||
float64_t i64_to_f64(int64_t, struct softfloat_status_t *);
|
||||
float16 i64_to_f16(int64_t, struct softfloat_status_t *);
|
||||
float32 i64_to_f32(int64_t, struct softfloat_status_t *);
|
||||
float64 i64_to_f64(int64_t, struct softfloat_status_t *);
|
||||
extFloat80_t i64_to_extF80(int64_t);
|
||||
float128_t i64_to_f128(int64_t);
|
||||
|
||||
BX_CPP_INLINE float16_t i16_to_f16(int16_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float16 i16_to_f16(int16_t a, struct softfloat_status_t *status) {
|
||||
return i32_to_f16((int32_t)(a), status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE float16_t ui16_to_f16(uint16_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float16 ui16_to_f16(uint16_t a, struct softfloat_status_t *status) {
|
||||
return ui32_to_f16((uint32_t)(a), status);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| 16-bit (half-precision) floating-point operations.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t f16_to_ui32(float16_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
uint64_t f16_to_ui64(float16_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
int32_t f16_to_i32(float16_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
int64_t f16_to_i64(float16_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
uint32_t f16_to_ui32_r_minMag(float16_t, bool, struct softfloat_status_t *);
|
||||
uint64_t f16_to_ui64_r_minMag(float16_t, bool, struct softfloat_status_t *);
|
||||
int32_t f16_to_i32_r_minMag(float16_t, bool, struct softfloat_status_t *);
|
||||
int64_t f16_to_i64_r_minMag(float16_t, bool, struct softfloat_status_t *);
|
||||
float32_t f16_to_f32(float16_t, struct softfloat_status_t *);
|
||||
float64_t f16_to_f64(float16_t, struct softfloat_status_t *);
|
||||
extFloat80_t f16_to_extF80(float16_t, struct softfloat_status_t *);
|
||||
float16_t f16_roundToInt(float16_t, uint8_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
float16_t f16_add(float16_t, float16_t, struct softfloat_status_t *);
|
||||
float16_t f16_sub(float16_t, float16_t, struct softfloat_status_t *);
|
||||
float16_t f16_mul(float16_t, float16_t, struct softfloat_status_t *);
|
||||
float16_t f16_mulAdd(float16_t, float16_t, float16_t, uint8_t op, struct softfloat_status_t *);
|
||||
float16_t f16_div(float16_t, float16_t, struct softfloat_status_t *);
|
||||
float16_t f16_min(float16_t, float16_t, struct softfloat_status_t *);
|
||||
float16_t f16_max(float16_t, float16_t, struct softfloat_status_t *);
|
||||
float16_t f16_getExp(float16_t, struct softfloat_status_t *);
|
||||
float16_t f16_getMant(float16_t, struct softfloat_status_t *, int, int);
|
||||
float16_t f16_range(float16_t, float16_t, bool is_max, bool is_abs, int sign_ctrl, softfloat_status_t *);
|
||||
int f16_compare(float16_t, float16_t, bool, struct softfloat_status_t *);
|
||||
float16_t f16_sqrt(float16_t, struct softfloat_status_t *);
|
||||
softfloat_class_t f16_class(float16_t);
|
||||
uint32_t f16_to_ui32(float16, uint8_t, bool, struct softfloat_status_t *);
|
||||
uint64_t f16_to_ui64(float16, uint8_t, bool, struct softfloat_status_t *);
|
||||
int32_t f16_to_i32(float16, uint8_t, bool, struct softfloat_status_t *);
|
||||
int64_t f16_to_i64(float16, uint8_t, bool, struct softfloat_status_t *);
|
||||
uint32_t f16_to_ui32_r_minMag(float16, bool, struct softfloat_status_t *);
|
||||
uint64_t f16_to_ui64_r_minMag(float16, bool, struct softfloat_status_t *);
|
||||
int32_t f16_to_i32_r_minMag(float16, bool, struct softfloat_status_t *);
|
||||
int64_t f16_to_i64_r_minMag(float16, bool, struct softfloat_status_t *);
|
||||
float32 f16_to_f32(float16, struct softfloat_status_t *);
|
||||
float64 f16_to_f64(float16, struct softfloat_status_t *);
|
||||
extFloat80_t f16_to_extF80(float16, struct softfloat_status_t *);
|
||||
float16 f16_roundToInt(float16, uint8_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
float16 f16_add(float16, float16, struct softfloat_status_t *);
|
||||
float16 f16_sub(float16, float16, struct softfloat_status_t *);
|
||||
float16 f16_mul(float16, float16, struct softfloat_status_t *);
|
||||
float16 f16_mulAdd(float16, float16, float16, uint8_t op, struct softfloat_status_t *);
|
||||
float16 f16_div(float16, float16, struct softfloat_status_t *);
|
||||
float16 f16_min(float16, float16, struct softfloat_status_t *);
|
||||
float16 f16_max(float16, float16, struct softfloat_status_t *);
|
||||
float16 f16_getExp(float16, struct softfloat_status_t *);
|
||||
float16 f16_getMant(float16, struct softfloat_status_t *, int, int);
|
||||
float16 f16_range(float16, float16, bool is_max, bool is_abs, int sign_ctrl, softfloat_status_t *);
|
||||
int f16_compare(float16, float16, bool, struct softfloat_status_t *);
|
||||
float16 f16_sqrt(float16, struct softfloat_status_t *);
|
||||
softfloat_class_t f16_class(float16);
|
||||
|
||||
bool f16_isSignalingNaN(float16_t);
|
||||
bool f16_isNaN(float16_t);
|
||||
bool f16_isSignalingNaN(float16);
|
||||
bool f16_isNaN(float16);
|
||||
|
||||
bool f16_sign(float16_t);
|
||||
int8_t f16_exp(float16_t);
|
||||
uint16_t f16_fraction(float16_t);
|
||||
float16_t f16_denormal_to_zero(float16_t);
|
||||
bool f16_sign(float16);
|
||||
int8_t f16_exp(float16);
|
||||
uint16_t f16_fraction(float16);
|
||||
float16 f16_denormal_to_zero(float16);
|
||||
|
||||
BX_CPP_INLINE int f16_compare(float16_t a, float16_t b, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int f16_compare(float16 a, float16 b, softfloat_status_t *status) {
|
||||
return f16_compare(a, b, 0, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int f16_compare_quiet(float16_t a, float16_t b, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int f16_compare_quiet(float16 a, float16 b, softfloat_status_t *status) {
|
||||
return f16_compare(a, b, 1, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE float16_t f16_roundToInt(float16_t a, uint8_t scale, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float16 f16_roundToInt(float16 a, uint8_t scale, struct softfloat_status_t *status) {
|
||||
return f16_roundToInt(a, scale, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
BX_CPP_INLINE float16_t f16_roundToInt(float16_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float16 f16_roundToInt(float16 a, struct softfloat_status_t *status) {
|
||||
return f16_roundToInt(a, 0, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int64_t f16_to_i64(float16_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int64_t f16_to_i64(float16 a, struct softfloat_status_t *status) {
|
||||
return f16_to_i64(a, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
BX_CPP_INLINE int32_t f16_to_i32(float16_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int32_t f16_to_i32(float16 a, struct softfloat_status_t *status) {
|
||||
return f16_to_i32(a, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int16_t f16_to_i16(float16_t a, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int16_t f16_to_i16(float16 a, softfloat_status_t *status)
|
||||
{
|
||||
int32_t val_32 = f16_to_i32(a, status);
|
||||
int16_t val_16 = (int16_t) val_32;
|
||||
@ -311,14 +311,14 @@ BX_CPP_INLINE int16_t f16_to_i16(float16_t a, softfloat_status_t *status)
|
||||
return val_16;
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int64_t f16_to_i64_round_to_zero(float16_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int64_t f16_to_i64_round_to_zero(float16 a, struct softfloat_status_t *status) {
|
||||
return f16_to_i64_r_minMag(a, true, status);
|
||||
}
|
||||
BX_CPP_INLINE int32_t f16_to_i32_round_to_zero(float16_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int32_t f16_to_i32_round_to_zero(float16 a, struct softfloat_status_t *status) {
|
||||
return f16_to_i32_r_minMag(a, true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int16_t f16_to_i16_round_to_zero(float16_t a, softfloat_status_t *status)
|
||||
BX_CPP_INLINE int16_t f16_to_i16_round_to_zero(float16 a, softfloat_status_t *status)
|
||||
{
|
||||
int32_t val_32 = f16_to_i32_round_to_zero(a, status);
|
||||
int16_t val_16 = (int16_t) val_32;
|
||||
@ -329,14 +329,14 @@ BX_CPP_INLINE int16_t f16_to_i16_round_to_zero(float16_t a, softfloat_status_t *
|
||||
return val_16;
|
||||
}
|
||||
|
||||
BX_CPP_INLINE uint64_t f16_to_ui64(float16_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE uint64_t f16_to_ui64(float16 a, struct softfloat_status_t *status) {
|
||||
return f16_to_ui64(a, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
BX_CPP_INLINE uint32_t f16_to_ui32(float16_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE uint32_t f16_to_ui32(float16 a, struct softfloat_status_t *status) {
|
||||
return f16_to_ui32(a, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE uint16_t f16_to_ui16(float16_t a, softfloat_status_t *status)
|
||||
BX_CPP_INLINE uint16_t f16_to_ui16(float16 a, softfloat_status_t *status)
|
||||
{
|
||||
uint32_t val_32 = f16_to_ui32(a, status);
|
||||
if (val_32 > 0xFFFF) {
|
||||
@ -346,14 +346,14 @@ BX_CPP_INLINE uint16_t f16_to_ui16(float16_t a, softfloat_status_t *status)
|
||||
return (uint16_t) val_32;
|
||||
}
|
||||
|
||||
BX_CPP_INLINE uint64_t f16_to_ui64_round_to_zero(float16_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE uint64_t f16_to_ui64_round_to_zero(float16 a, struct softfloat_status_t *status) {
|
||||
return f16_to_ui64_r_minMag(a, true, status);
|
||||
}
|
||||
BX_CPP_INLINE uint32_t f16_to_ui32_round_to_zero(float16_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE uint32_t f16_to_ui32_round_to_zero(float16 a, struct softfloat_status_t *status) {
|
||||
return f16_to_ui32_r_minMag(a, true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE uint16_t f16_to_ui16_round_to_zero(float16_t a, softfloat_status_t *status)
|
||||
BX_CPP_INLINE uint16_t f16_to_ui16_round_to_zero(float16 a, softfloat_status_t *status)
|
||||
{
|
||||
uint32_t val_32 = f16_to_ui32_round_to_zero(a, status);
|
||||
if (val_32 > 0xFFFF) {
|
||||
@ -363,208 +363,208 @@ BX_CPP_INLINE uint16_t f16_to_ui16_round_to_zero(float16_t a, softfloat_status_t
|
||||
return (uint16_t) val_32;
|
||||
}
|
||||
|
||||
BX_CPP_INLINE float16_t f16_fmadd(float16_t a, float16_t b, float16_t c, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float16 f16_fmadd(float16 a, float16 b, float16 c, softfloat_status_t *status) {
|
||||
return f16_mulAdd(a, b, c, 0, status);
|
||||
}
|
||||
BX_CPP_INLINE float16_t f16_fmsub(float16_t a, float16_t b, float16_t c, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float16 f16_fmsub(float16 a, float16 b, float16 c, softfloat_status_t *status) {
|
||||
return f16_mulAdd(a, b, c, softfloat_muladd_negate_c, status);
|
||||
}
|
||||
BX_CPP_INLINE float16_t f16_fnmadd(float16_t a, float16_t b, float16_t c, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float16 f16_fnmadd(float16 a, float16 b, float16 c, softfloat_status_t *status) {
|
||||
return f16_mulAdd(a, b, c, softfloat_muladd_negate_product, status);
|
||||
}
|
||||
BX_CPP_INLINE float16_t f16_fnmsub(float16_t a, float16_t b, float16_t c, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float16 f16_fnmsub(float16 a, float16 b, float16 c, softfloat_status_t *status) {
|
||||
return f16_mulAdd(a, b, c, softfloat_muladd_negate_result, status);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| 32-bit (single-precision) floating-point operations.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t f32_to_ui32(float32_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
uint64_t f32_to_ui64(float32_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
int32_t f32_to_i32(float32_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
int64_t f32_to_i64(float32_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
uint32_t f32_to_ui32_r_minMag(float32_t, bool, struct softfloat_status_t *);
|
||||
uint64_t f32_to_ui64_r_minMag(float32_t, bool, struct softfloat_status_t *);
|
||||
int32_t f32_to_i32_r_minMag(float32_t, bool, struct softfloat_status_t *);
|
||||
int64_t f32_to_i64_r_minMag(float32_t, bool, struct softfloat_status_t *);
|
||||
float16_t f32_to_f16(float32_t, struct softfloat_status_t *);
|
||||
float64_t f32_to_f64(float32_t, struct softfloat_status_t *);
|
||||
extFloat80_t f32_to_extF80(float32_t, struct softfloat_status_t *);
|
||||
float128_t f32_to_f128(float32_t, struct softfloat_status_t *);
|
||||
float32_t f32_roundToInt(float32_t, uint8_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
float32_t f32_add(float32_t, float32_t, struct softfloat_status_t *);
|
||||
float32_t f32_sub(float32_t, float32_t, struct softfloat_status_t *);
|
||||
float32_t f32_mul(float32_t, float32_t, struct softfloat_status_t *);
|
||||
float32_t f32_mulAdd(float32_t, float32_t, float32_t, uint8_t op, struct softfloat_status_t *);
|
||||
float32_t f32_div(float32_t, float32_t, struct softfloat_status_t *);
|
||||
float32_t f32_min(float32_t, float32_t, struct softfloat_status_t *);
|
||||
float32_t f32_max(float32_t, float32_t, struct softfloat_status_t *);
|
||||
float32_t f32_scalef(float32_t, float32_t, struct softfloat_status_t *);
|
||||
float32_t f32_getExp(float32_t, struct softfloat_status_t *);
|
||||
float32_t f32_getMant(float32_t, struct softfloat_status_t *, int, int);
|
||||
float32_t f32_range(float32_t, float32_t, bool is_max, bool is_abs, int sign_ctrl, softfloat_status_t *);
|
||||
float32_t f32_frc(float32_t, struct softfloat_status_t *);
|
||||
int f32_compare(float32_t, float32_t, bool, struct softfloat_status_t *);
|
||||
float32_t f32_sqrt(float32_t, struct softfloat_status_t *);
|
||||
softfloat_class_t f32_class(float32_t);
|
||||
uint32_t f32_to_ui32(float32, uint8_t, bool, struct softfloat_status_t *);
|
||||
uint64_t f32_to_ui64(float32, uint8_t, bool, struct softfloat_status_t *);
|
||||
int32_t f32_to_i32(float32, uint8_t, bool, struct softfloat_status_t *);
|
||||
int64_t f32_to_i64(float32, uint8_t, bool, struct softfloat_status_t *);
|
||||
uint32_t f32_to_ui32_r_minMag(float32, bool, struct softfloat_status_t *);
|
||||
uint64_t f32_to_ui64_r_minMag(float32, bool, struct softfloat_status_t *);
|
||||
int32_t f32_to_i32_r_minMag(float32, bool, struct softfloat_status_t *);
|
||||
int64_t f32_to_i64_r_minMag(float32, bool, struct softfloat_status_t *);
|
||||
float16 f32_to_f16(float32, struct softfloat_status_t *);
|
||||
float64 f32_to_f64(float32, struct softfloat_status_t *);
|
||||
extFloat80_t f32_to_extF80(float32, struct softfloat_status_t *);
|
||||
float128_t f32_to_f128(float32, struct softfloat_status_t *);
|
||||
float32 f32_roundToInt(float32, uint8_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
float32 f32_add(float32, float32, struct softfloat_status_t *);
|
||||
float32 f32_sub(float32, float32, struct softfloat_status_t *);
|
||||
float32 f32_mul(float32, float32, struct softfloat_status_t *);
|
||||
float32 f32_mulAdd(float32, float32, float32, uint8_t op, struct softfloat_status_t *);
|
||||
float32 f32_div(float32, float32, struct softfloat_status_t *);
|
||||
float32 f32_min(float32, float32, struct softfloat_status_t *);
|
||||
float32 f32_max(float32, float32, struct softfloat_status_t *);
|
||||
float32 f32_scalef(float32, float32, struct softfloat_status_t *);
|
||||
float32 f32_getExp(float32, struct softfloat_status_t *);
|
||||
float32 f32_getMant(float32, struct softfloat_status_t *, int, int);
|
||||
float32 f32_range(float32, float32, bool is_max, bool is_abs, int sign_ctrl, softfloat_status_t *);
|
||||
float32 f32_frc(float32, struct softfloat_status_t *);
|
||||
int f32_compare(float32, float32, bool, struct softfloat_status_t *);
|
||||
float32 f32_sqrt(float32, struct softfloat_status_t *);
|
||||
softfloat_class_t f32_class(float32);
|
||||
|
||||
bool f32_isSignalingNaN(float32_t);
|
||||
bool f32_isNaN(float32_t);
|
||||
bool f32_isSignalingNaN(float32);
|
||||
bool f32_isNaN(float32);
|
||||
|
||||
bool f32_sign(float32_t);
|
||||
int16_t f32_exp(float32_t);
|
||||
uint32_t f32_fraction(float32_t);
|
||||
float32_t f32_denormal_to_zero(float32_t);
|
||||
bool f32_sign(float32);
|
||||
int16_t f32_exp(float32);
|
||||
uint32_t f32_fraction(float32);
|
||||
float32 f32_denormal_to_zero(float32);
|
||||
|
||||
BX_CPP_INLINE int f32_compare(float32_t a, float32_t b, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int f32_compare(float32 a, float32 b, softfloat_status_t *status) {
|
||||
return f32_compare(a, b, 0, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int f32_compare_quiet(float32_t a, float32_t b, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int f32_compare_quiet(float32 a, float32 b, softfloat_status_t *status) {
|
||||
return f32_compare(a, b, 1, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE float32_t f32_roundToInt(float32_t a, uint8_t scale, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float32 f32_roundToInt(float32 a, uint8_t scale, struct softfloat_status_t *status) {
|
||||
return f32_roundToInt(a, scale, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
BX_CPP_INLINE float32_t f32_roundToInt(float32_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float32 f32_roundToInt(float32 a, struct softfloat_status_t *status) {
|
||||
return f32_roundToInt(a, 0, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int32_t f32_to_i32(float32_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int32_t f32_to_i32(float32 a, struct softfloat_status_t *status) {
|
||||
return f32_to_i32(a, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
BX_CPP_INLINE int64_t f32_to_i64(float32_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int64_t f32_to_i64(float32 a, struct softfloat_status_t *status) {
|
||||
return f32_to_i64(a, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int32_t f32_to_i32_round_to_zero(float32_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int32_t f32_to_i32_round_to_zero(float32 a, struct softfloat_status_t *status) {
|
||||
return f32_to_i32_r_minMag(a, true, status);
|
||||
}
|
||||
BX_CPP_INLINE int64_t f32_to_i64_round_to_zero(float32_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int64_t f32_to_i64_round_to_zero(float32 a, struct softfloat_status_t *status) {
|
||||
return f32_to_i64_r_minMag(a, true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE uint32_t f32_to_ui32(float32_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE uint32_t f32_to_ui32(float32 a, struct softfloat_status_t *status) {
|
||||
return f32_to_ui32(a, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
BX_CPP_INLINE uint64_t f32_to_ui64(float32_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE uint64_t f32_to_ui64(float32 a, struct softfloat_status_t *status) {
|
||||
return f32_to_ui64(a, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE uint32_t f32_to_ui32_round_to_zero(float32_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE uint32_t f32_to_ui32_round_to_zero(float32 a, struct softfloat_status_t *status) {
|
||||
return f32_to_ui32_r_minMag(a, true, status);
|
||||
}
|
||||
BX_CPP_INLINE uint64_t f32_to_ui64_round_to_zero(float32_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE uint64_t f32_to_ui64_round_to_zero(float32 a, struct softfloat_status_t *status) {
|
||||
return f32_to_ui64_r_minMag(a, true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE float32_t f32_fmadd(float32_t a, float32_t b, float32_t c, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float32 f32_fmadd(float32 a, float32 b, float32 c, softfloat_status_t *status) {
|
||||
return f32_mulAdd(a, b, c, 0, status);
|
||||
}
|
||||
BX_CPP_INLINE float32_t f32_fmsub(float32_t a, float32_t b, float32_t c, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float32 f32_fmsub(float32 a, float32 b, float32 c, softfloat_status_t *status) {
|
||||
return f32_mulAdd(a, b, c, softfloat_muladd_negate_c, status);
|
||||
}
|
||||
BX_CPP_INLINE float32_t f32_fnmadd(float32_t a, float32_t b, float32_t c, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float32 f32_fnmadd(float32 a, float32 b, float32 c, softfloat_status_t *status) {
|
||||
return f32_mulAdd(a, b, c, softfloat_muladd_negate_product, status);
|
||||
}
|
||||
BX_CPP_INLINE float32_t f32_fnmsub(float32_t a, float32_t b, float32_t c, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float32 f32_fnmsub(float32 a, float32 b, float32 c, softfloat_status_t *status) {
|
||||
return f32_mulAdd(a, b, c, softfloat_muladd_negate_result, status);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| 64-bit (double-precision) floating-point operations.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t f64_to_ui32(float64_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
uint64_t f64_to_ui64(float64_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
int32_t f64_to_i32(float64_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
int64_t f64_to_i64(float64_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
uint32_t f64_to_ui32_r_minMag(float64_t, bool, struct softfloat_status_t *);
|
||||
uint64_t f64_to_ui64_r_minMag(float64_t, bool, struct softfloat_status_t *);
|
||||
int32_t f64_to_i32_r_minMag(float64_t, bool, struct softfloat_status_t *);
|
||||
int64_t f64_to_i64_r_minMag(float64_t, bool, struct softfloat_status_t *);
|
||||
float16_t f64_to_f16(float64_t, struct softfloat_status_t *);
|
||||
float32_t f64_to_f32(float64_t, struct softfloat_status_t *);
|
||||
extFloat80_t f64_to_extF80(float64_t, struct softfloat_status_t *);
|
||||
float128_t f64_to_f128(float64_t, struct softfloat_status_t *);
|
||||
float64_t f64_roundToInt(float64_t, uint8_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
float64_t f64_add(float64_t, float64_t, struct softfloat_status_t *);
|
||||
float64_t f64_sub(float64_t, float64_t, struct softfloat_status_t *);
|
||||
float64_t f64_mul(float64_t, float64_t, struct softfloat_status_t *);
|
||||
float64_t f64_mulAdd(float64_t, float64_t, float64_t, uint8_t op, struct softfloat_status_t *);
|
||||
float64_t f64_div(float64_t, float64_t, struct softfloat_status_t *);
|
||||
float64_t f64_min(float64_t, float64_t, struct softfloat_status_t *);
|
||||
float64_t f64_max(float64_t, float64_t, struct softfloat_status_t *);
|
||||
float64_t f64_scalef(float64_t, float64_t, struct softfloat_status_t *);
|
||||
float64_t f64_getExp(float64_t, struct softfloat_status_t *);
|
||||
float64_t f64_getMant(float64_t, struct softfloat_status_t *, int, int);
|
||||
float64_t f64_range(float64_t, float64_t, bool is_max, bool is_abs, int sign_ctrl, softfloat_status_t *);
|
||||
float64_t f64_frc(float64_t, struct softfloat_status_t *);
|
||||
int f64_compare(float64_t, float64_t, bool, struct softfloat_status_t *);
|
||||
float64_t f64_sqrt(float64_t, struct softfloat_status_t *);
|
||||
softfloat_class_t f64_class(float64_t);
|
||||
uint32_t f64_to_ui32(float64, uint8_t, bool, struct softfloat_status_t *);
|
||||
uint64_t f64_to_ui64(float64, uint8_t, bool, struct softfloat_status_t *);
|
||||
int32_t f64_to_i32(float64, uint8_t, bool, struct softfloat_status_t *);
|
||||
int64_t f64_to_i64(float64, uint8_t, bool, struct softfloat_status_t *);
|
||||
uint32_t f64_to_ui32_r_minMag(float64, bool, struct softfloat_status_t *);
|
||||
uint64_t f64_to_ui64_r_minMag(float64, bool, struct softfloat_status_t *);
|
||||
int32_t f64_to_i32_r_minMag(float64, bool, struct softfloat_status_t *);
|
||||
int64_t f64_to_i64_r_minMag(float64, bool, struct softfloat_status_t *);
|
||||
float16 f64_to_f16(float64, struct softfloat_status_t *);
|
||||
float32 f64_to_f32(float64, struct softfloat_status_t *);
|
||||
extFloat80_t f64_to_extF80(float64, struct softfloat_status_t *);
|
||||
float128_t f64_to_f128(float64, struct softfloat_status_t *);
|
||||
float64 f64_roundToInt(float64, uint8_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
float64 f64_add(float64, float64, struct softfloat_status_t *);
|
||||
float64 f64_sub(float64, float64, struct softfloat_status_t *);
|
||||
float64 f64_mul(float64, float64, struct softfloat_status_t *);
|
||||
float64 f64_mulAdd(float64, float64, float64, uint8_t op, struct softfloat_status_t *);
|
||||
float64 f64_div(float64, float64, struct softfloat_status_t *);
|
||||
float64 f64_min(float64, float64, struct softfloat_status_t *);
|
||||
float64 f64_max(float64, float64, struct softfloat_status_t *);
|
||||
float64 f64_scalef(float64, float64, struct softfloat_status_t *);
|
||||
float64 f64_getExp(float64, struct softfloat_status_t *);
|
||||
float64 f64_getMant(float64, struct softfloat_status_t *, int, int);
|
||||
float64 f64_range(float64, float64, bool is_max, bool is_abs, int sign_ctrl, softfloat_status_t *);
|
||||
float64 f64_frc(float64, struct softfloat_status_t *);
|
||||
int f64_compare(float64, float64, bool, struct softfloat_status_t *);
|
||||
float64 f64_sqrt(float64, struct softfloat_status_t *);
|
||||
softfloat_class_t f64_class(float64);
|
||||
|
||||
bool f64_isSignalingNaN(float64_t);
|
||||
bool f64_isNaN(float64_t);
|
||||
bool f64_isSignalingNaN(float64);
|
||||
bool f64_isNaN(float64);
|
||||
|
||||
bool f64_sign(float64_t);
|
||||
int16_t f64_exp(float64_t);
|
||||
uint64_t f64_fraction(float64_t);
|
||||
float64_t f64_denormal_to_zero(float64_t);
|
||||
bool f64_sign(float64);
|
||||
int16_t f64_exp(float64);
|
||||
uint64_t f64_fraction(float64);
|
||||
float64 f64_denormal_to_zero(float64);
|
||||
|
||||
BX_CPP_INLINE int f64_compare(float64_t a, float64_t b, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int f64_compare(float64 a, float64 b, softfloat_status_t *status) {
|
||||
return f64_compare(a, b, 0, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int f64_compare_quiet(float64_t a, float64_t b, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int f64_compare_quiet(float64 a, float64 b, softfloat_status_t *status) {
|
||||
return f64_compare(a, b, 1, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE float64_t f64_roundToInt(float64_t a, uint8_t scale, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float64 f64_roundToInt(float64 a, uint8_t scale, struct softfloat_status_t *status) {
|
||||
return f64_roundToInt(a, scale, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
BX_CPP_INLINE float64_t f64_roundToInt(float64_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float64 f64_roundToInt(float64 a, struct softfloat_status_t *status) {
|
||||
return f64_roundToInt(a, 0, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int32_t f64_to_i32(float64_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int32_t f64_to_i32(float64 a, struct softfloat_status_t *status) {
|
||||
return f64_to_i32(a, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
BX_CPP_INLINE int64_t f64_to_i64(float64_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int64_t f64_to_i64(float64 a, struct softfloat_status_t *status) {
|
||||
return f64_to_i64(a, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE int32_t f64_to_i32_round_to_zero(float64_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int32_t f64_to_i32_round_to_zero(float64 a, struct softfloat_status_t *status) {
|
||||
return f64_to_i32_r_minMag(a, true, status);
|
||||
}
|
||||
BX_CPP_INLINE int64_t f64_to_i64_round_to_zero(float64_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE int64_t f64_to_i64_round_to_zero(float64 a, struct softfloat_status_t *status) {
|
||||
return f64_to_i64_r_minMag(a, true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE uint32_t f64_to_ui32(float64_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE uint32_t f64_to_ui32(float64 a, struct softfloat_status_t *status) {
|
||||
return f64_to_ui32(a, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
BX_CPP_INLINE uint64_t f64_to_ui64(float64_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE uint64_t f64_to_ui64(float64 a, struct softfloat_status_t *status) {
|
||||
return f64_to_ui64(a, softfloat_getRoundingMode(status), true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE uint32_t f64_to_ui32_round_to_zero(float64_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE uint32_t f64_to_ui32_round_to_zero(float64 a, struct softfloat_status_t *status) {
|
||||
return f64_to_ui32_r_minMag(a, true, status);
|
||||
}
|
||||
BX_CPP_INLINE uint64_t f64_to_ui64_round_to_zero(float64_t a, struct softfloat_status_t *status) {
|
||||
BX_CPP_INLINE uint64_t f64_to_ui64_round_to_zero(float64 a, struct softfloat_status_t *status) {
|
||||
return f64_to_ui64_r_minMag(a, true, status);
|
||||
}
|
||||
|
||||
BX_CPP_INLINE float64_t f64_fmadd(float64_t a, float64_t b, float64_t c, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float64 f64_fmadd(float64 a, float64 b, float64 c, softfloat_status_t *status) {
|
||||
return f64_mulAdd(a, b, c, 0, status);
|
||||
}
|
||||
BX_CPP_INLINE float64_t f64_fmsub(float64_t a, float64_t b, float64_t c, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float64 f64_fmsub(float64 a, float64 b, float64 c, softfloat_status_t *status) {
|
||||
return f64_mulAdd(a, b, c, softfloat_muladd_negate_c, status);
|
||||
}
|
||||
BX_CPP_INLINE float64_t f64_fnmadd(float64_t a, float64_t b, float64_t c, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float64 f64_fnmadd(float64 a, float64 b, float64 c, softfloat_status_t *status) {
|
||||
return f64_mulAdd(a, b, c, softfloat_muladd_negate_product, status);
|
||||
}
|
||||
BX_CPP_INLINE float64_t f64_fnmsub(float64_t a, float64_t b, float64_t c, softfloat_status_t *status) {
|
||||
BX_CPP_INLINE float64 f64_fnmsub(float64 a, float64 b, float64 c, softfloat_status_t *status) {
|
||||
return f64_mulAdd(a, b, c, softfloat_muladd_negate_result, status);
|
||||
}
|
||||
|
||||
@ -579,9 +579,9 @@ uint32_t extF80_to_ui32_r_minMag(extFloat80_t, bool, struct softfloat_status_t *
|
||||
uint64_t extF80_to_ui64_r_minMag(extFloat80_t, bool, struct softfloat_status_t *);
|
||||
int32_t extF80_to_i32_r_minMag(extFloat80_t, bool, struct softfloat_status_t *);
|
||||
int64_t extF80_to_i64_r_minMag(extFloat80_t, bool, struct softfloat_status_t *);
|
||||
float16_t extF80_to_f16(extFloat80_t, struct softfloat_status_t *);
|
||||
float32_t extF80_to_f32(extFloat80_t, struct softfloat_status_t *);
|
||||
float64_t extF80_to_f64(extFloat80_t, struct softfloat_status_t *);
|
||||
float16 extF80_to_f16(extFloat80_t, struct softfloat_status_t *);
|
||||
float32 extF80_to_f32(extFloat80_t, struct softfloat_status_t *);
|
||||
float64 extF80_to_f64(extFloat80_t, struct softfloat_status_t *);
|
||||
float128_t extF80_to_f128(extFloat80_t, struct softfloat_status_t *);
|
||||
extFloat80_t extF80_roundToInt(extFloat80_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
extFloat80_t extF80_add(extFloat80_t, extFloat80_t, struct softfloat_status_t *);
|
||||
@ -649,9 +649,9 @@ bool extF80_isUnsupported(extFloat80_t);
|
||||
bool extF80_isSignalingNaN(extFloat80_t);
|
||||
bool extF80_isNaN(extFloat80_t);
|
||||
|
||||
bool extF80_sign(float64_t);
|
||||
int16_t extF80_exp(float64_t);
|
||||
uint64_t extF80_fraction(float64_t);
|
||||
bool extF80_sign(float64);
|
||||
int16_t extF80_exp(float64);
|
||||
uint64_t extF80_fraction(float64);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| 128-bit (quadruple-precision) floating-point operations.
|
||||
@ -664,8 +664,8 @@ uint32_t f128_to_ui32_r_minMag(float128_t, bool, struct softfloat_status_t *);
|
||||
uint64_t f128_to_ui64_r_minMag(float128_t, bool, struct softfloat_status_t *);
|
||||
int32_t f128_to_i32_r_minMag(float128_t, bool, struct softfloat_status_t *);
|
||||
int64_t f128_to_i64_r_minMag(float128_t, bool, struct softfloat_status_t *);
|
||||
float32_t f128_to_f32(float128_t, struct softfloat_status_t *);
|
||||
float64_t f128_to_f64(float128_t, struct softfloat_status_t *);
|
||||
float32 f128_to_f32(float128_t, struct softfloat_status_t *);
|
||||
float64 f128_to_f64(float128_t, struct softfloat_status_t *);
|
||||
extFloat80_t f128_to_extF80(float128_t, struct softfloat_status_t *);
|
||||
float128_t f128_roundToInt(float128_t, uint8_t, bool, struct softfloat_status_t *);
|
||||
float128_t f128_add(float128_t, float128_t, struct softfloat_status_t *);
|
||||
|
@ -61,23 +61,29 @@ struct uint128_extra { struct uint128 v; uint64_t extra; };
|
||||
| arguments and results to/from functions. These types must be exactly
|
||||
| 16 bits, 32 bits, 64 bits, and 128 bits in size, respectively.
|
||||
*----------------------------------------------------------------------------*/
|
||||
typedef struct f16_t {
|
||||
struct f16_t {
|
||||
uint16_t v;
|
||||
#ifdef __cplusplus
|
||||
f16_t(uint64_t v16): v(v16) {}
|
||||
operator uint16_t() const { return v; }
|
||||
} float16_t;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct f32_t {
|
||||
struct f32_t {
|
||||
uint32_t v;
|
||||
#ifdef __cplusplus
|
||||
f32_t(uint64_t v32): v(v32) {}
|
||||
operator uint32_t() const { return v; }
|
||||
} float32_t;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct f64_t {
|
||||
struct f64_t {
|
||||
uint64_t v;
|
||||
#ifdef __cplusplus
|
||||
f64_t(uint64_t v64): v(v64) {}
|
||||
operator uint64_t() const { return v; }
|
||||
} float64_t;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef uint128 float128_t;
|
||||
|
||||
|
@ -38,17 +38,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
bool f16_isNaN(float16_t a)
|
||||
bool f16_isNaN(float16 a)
|
||||
{
|
||||
return isNaNF16UI(a);
|
||||
}
|
||||
|
||||
bool f32_isNaN(float32_t a)
|
||||
bool f32_isNaN(float32 a)
|
||||
{
|
||||
return isNaNF32UI(a);
|
||||
}
|
||||
|
||||
bool f64_isNaN(float64_t a)
|
||||
bool f64_isNaN(float64 a)
|
||||
{
|
||||
return isNaNF64UI(a);
|
||||
}
|
||||
|
@ -38,17 +38,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
bool f16_isSignalingNaN(float16_t a)
|
||||
bool f16_isSignalingNaN(float16 a)
|
||||
{
|
||||
return softfloat_isSigNaNF16UI(a);
|
||||
}
|
||||
|
||||
bool f32_isSignalingNaN(float32_t a)
|
||||
bool f32_isSignalingNaN(float32 a)
|
||||
{
|
||||
return softfloat_isSigNaNF32UI(a);
|
||||
}
|
||||
|
||||
bool f64_isSignalingNaN(float64_t a)
|
||||
bool f64_isSignalingNaN(float64 a)
|
||||
{
|
||||
return softfloat_isSigNaNF64UI(a);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float16_t softfloat_addMagsF16(uint16_t uiA, uint16_t uiB, struct softfloat_status_t *status)
|
||||
float16 softfloat_addMagsF16(uint16_t uiA, uint16_t uiB, struct softfloat_status_t *status)
|
||||
{
|
||||
int8_t expA;
|
||||
uint16_t sigA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "primitives.h"
|
||||
#include "specialize.h"
|
||||
|
||||
float32_t softfloat_addMagsF32(uint32_t uiA, uint32_t uiB, struct softfloat_status_t *status)
|
||||
float32 softfloat_addMagsF32(uint32_t uiA, uint32_t uiB, struct softfloat_status_t *status)
|
||||
{
|
||||
int16_t expA;
|
||||
uint32_t sigA;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "primitives.h"
|
||||
#include "specialize.h"
|
||||
|
||||
float64_t softfloat_addMagsF64(uint64_t uiA, uint64_t uiB, bool signZ, struct softfloat_status_t *status)
|
||||
float64 softfloat_addMagsF64(uint64_t uiA, uint64_t uiB, bool signZ, struct softfloat_status_t *status)
|
||||
{
|
||||
int16_t expA;
|
||||
uint64_t sigA;
|
||||
|
@ -38,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "internals.h"
|
||||
#include "primitives.h"
|
||||
|
||||
float16_t softfloat_normRoundPackToF16(bool sign, int16_t exp, uint16_t sig, struct softfloat_status_t *status)
|
||||
float16 softfloat_normRoundPackToF16(bool sign, int16_t exp, uint16_t sig, struct softfloat_status_t *status)
|
||||
{
|
||||
int8_t shiftDist = softfloat_countLeadingZeros16(sig) - 1;
|
||||
exp -= shiftDist;
|
||||
|
@ -38,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "internals.h"
|
||||
#include "primitives.h"
|
||||
|
||||
float32_t softfloat_normRoundPackToF32(bool sign, int16_t exp, uint32_t sig, struct softfloat_status_t *status)
|
||||
float32 softfloat_normRoundPackToF32(bool sign, int16_t exp, uint32_t sig, struct softfloat_status_t *status)
|
||||
{
|
||||
int8_t shiftDist = softfloat_countLeadingZeros32(sig) - 1;
|
||||
exp -= shiftDist;
|
||||
|
@ -38,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "internals.h"
|
||||
#include "primitives.h"
|
||||
|
||||
float64_t softfloat_normRoundPackToF64(bool sign, int16_t exp, uint64_t sig, struct softfloat_status_t *status)
|
||||
float64 softfloat_normRoundPackToF64(bool sign, int16_t exp, uint64_t sig, struct softfloat_status_t *status)
|
||||
{
|
||||
int8_t shiftDist = softfloat_countLeadingZeros64(sig) - 1;
|
||||
exp -= shiftDist;
|
||||
|
@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "primitives.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
float16_t
|
||||
float16
|
||||
softfloat_roundPackToF16(bool sign, int16_t exp, uint16_t sig, struct softfloat_status_t *status)
|
||||
{
|
||||
uint8_t roundingMode;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user