sbv-14.8: SBVTestSuite/GoldFiles/floats_cgen.gold
== BEGIN: "toFP_Int8_ToFloat.c" ================
/* File: "toFP_Int8_ToFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat toFP_Int8_ToFloat(const SInt8 sbv_input_0)
{
const SInt8 s0 = sbv_input_0;
SFloat s2;
s2 = (SFloat) s0;
return s2;
}
== END: "toFP_Int8_ToFloat.c" ==================
== BEGIN: "toFP_Int16_ToFloat.c" ================
/* File: "toFP_Int16_ToFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat toFP_Int16_ToFloat(const SInt16 sbv_input_0)
{
const SInt16 s0 = sbv_input_0;
SFloat s2;
s2 = (SFloat) s0;
return s2;
}
== END: "toFP_Int16_ToFloat.c" ==================
== BEGIN: "toFP_Int32_ToFloat.c" ================
/* File: "toFP_Int32_ToFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SFloat sbv_fp_cast_s32_float(SInt32 a, bf_rnd_t rnd)
{
uint64_t words[1]; uint64_t carry = 1; size_t i; limb_t j;
const bool negative = ((((uint64_t) a) >> (31)) & UINT64_C(1)) != 0;
bf_context_t ctx; bf_t x, chunk; double result;
for (i = 0; i < 1; ++i) {
words[i] = 0;
for (j = 0; j < 64 && i * 64 + j < 32; ++j)
if (((((uint64_t) a) >> ((i * 64 + j))) & UINT64_C(1)) != 0) words[i] |= UINT64_C(1) << j;
}
if (negative) for (i = 0; i < 1; ++i) {
const uint64_t next = ~words[i] + carry; carry = carry && next == 0; words[i] = next;
}
words[0] &= UINT64_C(0x00000000ffffffff);
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_init(&ctx, &chunk); bf_set_ui(&x, 0);
for (i = 1; i-- > 0;) {
bf_mul_2exp(&x, i == 0 ? 32 : 64, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
bf_set_ui(&chunk, words[i]); bf_add(&x, &x, &chunk, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
}
if (negative) bf_neg(&x);
bf_round(&x, 24, BF_FLAG_SUBNORMAL | bf_set_exp_bits(8) | (bf_flags_t) rnd); bf_get_float64(&x, &result, rnd);
bf_delete(&chunk); bf_delete(&x); bf_context_end(&ctx); return (SFloat) result;
}
SFloat toFP_Int32_ToFloat(const SInt32 sbv_input_0)
{
const SInt32 s0 = sbv_input_0;
SFloat s2;
s2 = sbv_fp_cast_s32_float(s0, BF_RNDN);
return s2;
}
== END: "toFP_Int32_ToFloat.c" ==================
== BEGIN: "toFP_Int64_ToFloat.c" ================
/* File: "toFP_Int64_ToFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SFloat sbv_fp_cast_s64_float(SInt64 a, bf_rnd_t rnd)
{
uint64_t words[1]; uint64_t carry = 1; size_t i; limb_t j;
const bool negative = ((((uint64_t) a) >> (63)) & UINT64_C(1)) != 0;
bf_context_t ctx; bf_t x, chunk; double result;
for (i = 0; i < 1; ++i) {
words[i] = 0;
for (j = 0; j < 64 && i * 64 + j < 64; ++j)
if (((((uint64_t) a) >> ((i * 64 + j))) & UINT64_C(1)) != 0) words[i] |= UINT64_C(1) << j;
}
if (negative) for (i = 0; i < 1; ++i) {
const uint64_t next = ~words[i] + carry; carry = carry && next == 0; words[i] = next;
}
words[0] &= UINT64_C(0xffffffffffffffff);
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_init(&ctx, &chunk); bf_set_ui(&x, 0);
for (i = 1; i-- > 0;) {
bf_mul_2exp(&x, i == 0 ? 64 : 64, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
bf_set_ui(&chunk, words[i]); bf_add(&x, &x, &chunk, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
}
if (negative) bf_neg(&x);
bf_round(&x, 24, BF_FLAG_SUBNORMAL | bf_set_exp_bits(8) | (bf_flags_t) rnd); bf_get_float64(&x, &result, rnd);
bf_delete(&chunk); bf_delete(&x); bf_context_end(&ctx); return (SFloat) result;
}
SFloat toFP_Int64_ToFloat(const SInt64 sbv_input_0)
{
const SInt64 s0 = sbv_input_0;
SFloat s2;
s2 = sbv_fp_cast_s64_float(s0, BF_RNDN);
return s2;
}
== END: "toFP_Int64_ToFloat.c" ==================
== BEGIN: "toFP_Word8_ToFloat.c" ================
/* File: "toFP_Word8_ToFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat toFP_Word8_ToFloat(const SWord8 sbv_input_0)
{
const SWord8 s0 = sbv_input_0;
SFloat s2;
s2 = (SFloat) s0;
return s2;
}
== END: "toFP_Word8_ToFloat.c" ==================
== BEGIN: "toFP_Word16_ToFloat.c" ================
/* File: "toFP_Word16_ToFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat toFP_Word16_ToFloat(const SWord16 sbv_input_0)
{
const SWord16 s0 = sbv_input_0;
SFloat s2;
s2 = (SFloat) s0;
return s2;
}
== END: "toFP_Word16_ToFloat.c" ==================
== BEGIN: "toFP_Word32_ToFloat.c" ================
/* File: "toFP_Word32_ToFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SFloat sbv_fp_cast_u32_float(SWord32 a, bf_rnd_t rnd)
{
uint64_t words[1]; uint64_t carry = 1; size_t i; limb_t j;
const bool negative = false;
bf_context_t ctx; bf_t x, chunk; double result;
for (i = 0; i < 1; ++i) {
words[i] = 0;
for (j = 0; j < 64 && i * 64 + j < 32; ++j)
if (((((uint64_t) a) >> ((i * 64 + j))) & UINT64_C(1)) != 0) words[i] |= UINT64_C(1) << j;
}
if (negative) for (i = 0; i < 1; ++i) {
const uint64_t next = ~words[i] + carry; carry = carry && next == 0; words[i] = next;
}
words[0] &= UINT64_C(0x00000000ffffffff);
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_init(&ctx, &chunk); bf_set_ui(&x, 0);
for (i = 1; i-- > 0;) {
bf_mul_2exp(&x, i == 0 ? 32 : 64, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
bf_set_ui(&chunk, words[i]); bf_add(&x, &x, &chunk, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
}
if (negative) bf_neg(&x);
bf_round(&x, 24, BF_FLAG_SUBNORMAL | bf_set_exp_bits(8) | (bf_flags_t) rnd); bf_get_float64(&x, &result, rnd);
bf_delete(&chunk); bf_delete(&x); bf_context_end(&ctx); return (SFloat) result;
}
SFloat toFP_Word32_ToFloat(const SWord32 sbv_input_0)
{
const SWord32 s0 = sbv_input_0;
SFloat s2;
s2 = sbv_fp_cast_u32_float(s0, BF_RNDN);
return s2;
}
== END: "toFP_Word32_ToFloat.c" ==================
== BEGIN: "toFP_Word64_ToFloat.c" ================
/* File: "toFP_Word64_ToFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SFloat sbv_fp_cast_u64_float(SWord64 a, bf_rnd_t rnd)
{
uint64_t words[1]; uint64_t carry = 1; size_t i; limb_t j;
const bool negative = false;
bf_context_t ctx; bf_t x, chunk; double result;
for (i = 0; i < 1; ++i) {
words[i] = 0;
for (j = 0; j < 64 && i * 64 + j < 64; ++j)
if (((((uint64_t) a) >> ((i * 64 + j))) & UINT64_C(1)) != 0) words[i] |= UINT64_C(1) << j;
}
if (negative) for (i = 0; i < 1; ++i) {
const uint64_t next = ~words[i] + carry; carry = carry && next == 0; words[i] = next;
}
words[0] &= UINT64_C(0xffffffffffffffff);
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_init(&ctx, &chunk); bf_set_ui(&x, 0);
for (i = 1; i-- > 0;) {
bf_mul_2exp(&x, i == 0 ? 64 : 64, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
bf_set_ui(&chunk, words[i]); bf_add(&x, &x, &chunk, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
}
if (negative) bf_neg(&x);
bf_round(&x, 24, BF_FLAG_SUBNORMAL | bf_set_exp_bits(8) | (bf_flags_t) rnd); bf_get_float64(&x, &result, rnd);
bf_delete(&chunk); bf_delete(&x); bf_context_end(&ctx); return (SFloat) result;
}
SFloat toFP_Word64_ToFloat(const SWord64 sbv_input_0)
{
const SWord64 s0 = sbv_input_0;
SFloat s2;
s2 = sbv_fp_cast_u64_float(s0, BF_RNDN);
return s2;
}
== END: "toFP_Word64_ToFloat.c" ==================
== BEGIN: "toFP_Float_ToFloat.c" ================
/* File: "toFP_Float_ToFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat toFP_Float_ToFloat(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
return s0;
}
== END: "toFP_Float_ToFloat.c" ==================
== BEGIN: "toFP_Double_ToFloat.c" ================
/* File: "toFP_Double_ToFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SFloat sbv_fp_cast_double_float(SDouble a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; double result;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a);
bf_round(&x, 24, BF_FLAG_SUBNORMAL | bf_set_exp_bits(8) | (bf_flags_t) rnd); bf_get_float64(&x, &result, rnd);
bf_delete(&x); bf_context_end(&ctx); return (SFloat) result;
}
SFloat toFP_Double_ToFloat(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SFloat s2;
s2 = sbv_fp_cast_double_float(s0, BF_RNDN);
return s2;
}
== END: "toFP_Double_ToFloat.c" ==================
== BEGIN: "toFP_Integer_ToFloat.c" ================
/* File: "toFP_Integer_ToFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SFloat sbv_fp_cast_integer_float(SInt64 a, bf_rnd_t rnd)
{
uint64_t words[1]; uint64_t carry = 1; size_t i; limb_t j;
const bool negative = ((((uint64_t) a) >> (63)) & UINT64_C(1)) != 0;
bf_context_t ctx; bf_t x, chunk; double result;
for (i = 0; i < 1; ++i) {
words[i] = 0;
for (j = 0; j < 64 && i * 64 + j < 64; ++j)
if (((((uint64_t) a) >> ((i * 64 + j))) & UINT64_C(1)) != 0) words[i] |= UINT64_C(1) << j;
}
if (negative) for (i = 0; i < 1; ++i) {
const uint64_t next = ~words[i] + carry; carry = carry && next == 0; words[i] = next;
}
words[0] &= UINT64_C(0xffffffffffffffff);
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_init(&ctx, &chunk); bf_set_ui(&x, 0);
for (i = 1; i-- > 0;) {
bf_mul_2exp(&x, i == 0 ? 64 : 64, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
bf_set_ui(&chunk, words[i]); bf_add(&x, &x, &chunk, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
}
if (negative) bf_neg(&x);
bf_round(&x, 24, BF_FLAG_SUBNORMAL | bf_set_exp_bits(8) | (bf_flags_t) rnd); bf_get_float64(&x, &result, rnd);
bf_delete(&chunk); bf_delete(&x); bf_context_end(&ctx); return (SFloat) result;
}
SFloat toFP_Integer_ToFloat(const SInteger sbv_input_0)
{
const SInteger s0 = sbv_input_0;
SFloat s2;
s2 = sbv_fp_cast_integer_float(s0, BF_RNDN);
return s2;
}
== END: "toFP_Integer_ToFloat.c" ==================
== BEGIN: "toFP_Real_ToFloat.c" ================
/* File: "toFP_Real_ToFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
#include <float.h>
#if FLT_RADIX == 2 && LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 && LDBL_MIN_EXP == -1021
#define SBV_LDBL_EXP_BITS 11
#elif FLT_RADIX == 2 && (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 && LDBL_MIN_EXP == -16381
#define SBV_LDBL_EXP_BITS 15
#else
#error SBV C long-double conversions require binary64, x87 extended, or binary128 long double
#endif
#if BF_EXP_BITS_MAX < SBV_LDBL_EXP_BITS
#error SBV C long-double conversions exceed the LibBF exponent range
#endif
static SBV_CGEN_UNUSED bf_flags_t sbv_bf_long_double_flags(bf_rnd_t rnd)
{
return BF_FLAG_SUBNORMAL | bf_set_exp_bits(SBV_LDBL_EXP_BITS) | (bf_flags_t) rnd;
}
static SBV_CGEN_UNUSED void sbv_bf_set_long_double(bf_t *result, long double value)
{
int exponent, shift = 0, status = 0; bf_t chunk;
if (isnan(value)) { bf_set_nan(result); return; }
if (isinf(value)) { bf_set_inf(result, signbit(value) != 0); return; }
if (value == 0) { bf_set_zero(result, signbit(value) != 0); return; }
long double fraction = frexpl(fabsl(value), &exponent);
bf_init(result->ctx, &chunk); bf_set_zero(result, 0);
while (fraction != 0) {
fraction = ldexpl(fraction, 32);
const uint32_t bits = (uint32_t) fraction; fraction -= (long double) bits;
status |= bf_mul_2exp(result, 32, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
status |= bf_set_ui(&chunk, bits);
status |= bf_add(result, result, &chunk, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ); shift += 32;
}
status |= bf_mul_2exp(result, exponent - shift, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
bf_delete(&chunk); if (status & BF_ST_MEM_ERROR) abort();
if (signbit(value)) bf_neg(result);
}
static SBV_CGEN_UNUSED long double sbv_bf_get_long_double(bf_t *value, bf_rnd_t rnd)
{
if (bf_round(value, LDBL_MANT_DIG, sbv_bf_long_double_flags(rnd)) & BF_ST_MEM_ERROR) abort();
if (bf_is_nan(value)) return nanl("");
if (!bf_is_finite(value)) return value->sign ? -HUGE_VALL : HUGE_VALL;
if (bf_is_zero(value)) return value->sign ? -0.0L : 0.0L;
long double significand = 0;
const slimb_t base = (slimb_t) value->len * LIMB_BITS;
for (int i = 0; i < LDBL_MANT_DIG; ++i) {
const slimb_t bit = base - 1 - i;
const unsigned digit = bit < 0 ? 0 : (unsigned) ((value->tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1);
significand = significand * 2 + digit;
}
const long double result = ldexpl(significand, (int) value->expn - LDBL_MANT_DIG);
return value->sign ? -result : result;
}
static SBV_CGEN_UNUSED inline SFloat sbv_fp_cast_real_float(SReal a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; double result;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); sbv_bf_set_long_double(&x, a);
bf_round(&x, 24, BF_FLAG_SUBNORMAL | bf_set_exp_bits(8) | (bf_flags_t) rnd); bf_get_float64(&x, &result, rnd);
bf_delete(&x); bf_context_end(&ctx); return (SFloat) result;
}
SFloat toFP_Real_ToFloat(const SReal sbv_input_0)
{
const SReal s0 = sbv_input_0;
SFloat s2;
s2 = sbv_fp_cast_real_float(s0, BF_RNDN);
return s2;
}
== END: "toFP_Real_ToFloat.c" ==================
== BEGIN: "toFP_Int8_ToDouble.c" ================
/* File: "toFP_Int8_ToDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble toFP_Int8_ToDouble(const SInt8 sbv_input_0)
{
const SInt8 s0 = sbv_input_0;
SDouble s2;
s2 = (SDouble) s0;
return s2;
}
== END: "toFP_Int8_ToDouble.c" ==================
== BEGIN: "toFP_Int16_ToDouble.c" ================
/* File: "toFP_Int16_ToDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble toFP_Int16_ToDouble(const SInt16 sbv_input_0)
{
const SInt16 s0 = sbv_input_0;
SDouble s2;
s2 = (SDouble) s0;
return s2;
}
== END: "toFP_Int16_ToDouble.c" ==================
== BEGIN: "toFP_Int32_ToDouble.c" ================
/* File: "toFP_Int32_ToDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble toFP_Int32_ToDouble(const SInt32 sbv_input_0)
{
const SInt32 s0 = sbv_input_0;
SDouble s2;
s2 = (SDouble) s0;
return s2;
}
== END: "toFP_Int32_ToDouble.c" ==================
== BEGIN: "toFP_Int64_ToDouble.c" ================
/* File: "toFP_Int64_ToDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SDouble sbv_fp_cast_s64_double(SInt64 a, bf_rnd_t rnd)
{
uint64_t words[1]; uint64_t carry = 1; size_t i; limb_t j;
const bool negative = ((((uint64_t) a) >> (63)) & UINT64_C(1)) != 0;
bf_context_t ctx; bf_t x, chunk; double result;
for (i = 0; i < 1; ++i) {
words[i] = 0;
for (j = 0; j < 64 && i * 64 + j < 64; ++j)
if (((((uint64_t) a) >> ((i * 64 + j))) & UINT64_C(1)) != 0) words[i] |= UINT64_C(1) << j;
}
if (negative) for (i = 0; i < 1; ++i) {
const uint64_t next = ~words[i] + carry; carry = carry && next == 0; words[i] = next;
}
words[0] &= UINT64_C(0xffffffffffffffff);
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_init(&ctx, &chunk); bf_set_ui(&x, 0);
for (i = 1; i-- > 0;) {
bf_mul_2exp(&x, i == 0 ? 64 : 64, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
bf_set_ui(&chunk, words[i]); bf_add(&x, &x, &chunk, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
}
if (negative) bf_neg(&x);
bf_round(&x, 53, BF_FLAG_SUBNORMAL | bf_set_exp_bits(11) | (bf_flags_t) rnd); bf_get_float64(&x, &result, rnd);
bf_delete(&chunk); bf_delete(&x); bf_context_end(&ctx); return (SDouble) result;
}
SDouble toFP_Int64_ToDouble(const SInt64 sbv_input_0)
{
const SInt64 s0 = sbv_input_0;
SDouble s2;
s2 = sbv_fp_cast_s64_double(s0, BF_RNDN);
return s2;
}
== END: "toFP_Int64_ToDouble.c" ==================
== BEGIN: "toFP_Word8_ToDouble.c" ================
/* File: "toFP_Word8_ToDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble toFP_Word8_ToDouble(const SWord8 sbv_input_0)
{
const SWord8 s0 = sbv_input_0;
SDouble s2;
s2 = (SDouble) s0;
return s2;
}
== END: "toFP_Word8_ToDouble.c" ==================
== BEGIN: "toFP_Word16_ToDouble.c" ================
/* File: "toFP_Word16_ToDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble toFP_Word16_ToDouble(const SWord16 sbv_input_0)
{
const SWord16 s0 = sbv_input_0;
SDouble s2;
s2 = (SDouble) s0;
return s2;
}
== END: "toFP_Word16_ToDouble.c" ==================
== BEGIN: "toFP_Word32_ToDouble.c" ================
/* File: "toFP_Word32_ToDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble toFP_Word32_ToDouble(const SWord32 sbv_input_0)
{
const SWord32 s0 = sbv_input_0;
SDouble s2;
s2 = (SDouble) s0;
return s2;
}
== END: "toFP_Word32_ToDouble.c" ==================
== BEGIN: "toFP_Word64_ToDouble.c" ================
/* File: "toFP_Word64_ToDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SDouble sbv_fp_cast_u64_double(SWord64 a, bf_rnd_t rnd)
{
uint64_t words[1]; uint64_t carry = 1; size_t i; limb_t j;
const bool negative = false;
bf_context_t ctx; bf_t x, chunk; double result;
for (i = 0; i < 1; ++i) {
words[i] = 0;
for (j = 0; j < 64 && i * 64 + j < 64; ++j)
if (((((uint64_t) a) >> ((i * 64 + j))) & UINT64_C(1)) != 0) words[i] |= UINT64_C(1) << j;
}
if (negative) for (i = 0; i < 1; ++i) {
const uint64_t next = ~words[i] + carry; carry = carry && next == 0; words[i] = next;
}
words[0] &= UINT64_C(0xffffffffffffffff);
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_init(&ctx, &chunk); bf_set_ui(&x, 0);
for (i = 1; i-- > 0;) {
bf_mul_2exp(&x, i == 0 ? 64 : 64, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
bf_set_ui(&chunk, words[i]); bf_add(&x, &x, &chunk, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
}
if (negative) bf_neg(&x);
bf_round(&x, 53, BF_FLAG_SUBNORMAL | bf_set_exp_bits(11) | (bf_flags_t) rnd); bf_get_float64(&x, &result, rnd);
bf_delete(&chunk); bf_delete(&x); bf_context_end(&ctx); return (SDouble) result;
}
SDouble toFP_Word64_ToDouble(const SWord64 sbv_input_0)
{
const SWord64 s0 = sbv_input_0;
SDouble s2;
s2 = sbv_fp_cast_u64_double(s0, BF_RNDN);
return s2;
}
== END: "toFP_Word64_ToDouble.c" ==================
== BEGIN: "toFP_Float_ToDouble.c" ================
/* File: "toFP_Float_ToDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble toFP_Float_ToDouble(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SDouble s2;
s2 = (SDouble) s0;
return s2;
}
== END: "toFP_Float_ToDouble.c" ==================
== BEGIN: "toFP_Double_ToDouble.c" ================
/* File: "toFP_Double_ToDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble toFP_Double_ToDouble(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
return s0;
}
== END: "toFP_Double_ToDouble.c" ==================
== BEGIN: "toFP_Integer_ToDouble.c" ================
/* File: "toFP_Integer_ToDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SDouble sbv_fp_cast_integer_double(SInt64 a, bf_rnd_t rnd)
{
uint64_t words[1]; uint64_t carry = 1; size_t i; limb_t j;
const bool negative = ((((uint64_t) a) >> (63)) & UINT64_C(1)) != 0;
bf_context_t ctx; bf_t x, chunk; double result;
for (i = 0; i < 1; ++i) {
words[i] = 0;
for (j = 0; j < 64 && i * 64 + j < 64; ++j)
if (((((uint64_t) a) >> ((i * 64 + j))) & UINT64_C(1)) != 0) words[i] |= UINT64_C(1) << j;
}
if (negative) for (i = 0; i < 1; ++i) {
const uint64_t next = ~words[i] + carry; carry = carry && next == 0; words[i] = next;
}
words[0] &= UINT64_C(0xffffffffffffffff);
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_init(&ctx, &chunk); bf_set_ui(&x, 0);
for (i = 1; i-- > 0;) {
bf_mul_2exp(&x, i == 0 ? 64 : 64, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
bf_set_ui(&chunk, words[i]); bf_add(&x, &x, &chunk, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
}
if (negative) bf_neg(&x);
bf_round(&x, 53, BF_FLAG_SUBNORMAL | bf_set_exp_bits(11) | (bf_flags_t) rnd); bf_get_float64(&x, &result, rnd);
bf_delete(&chunk); bf_delete(&x); bf_context_end(&ctx); return (SDouble) result;
}
SDouble toFP_Integer_ToDouble(const SInteger sbv_input_0)
{
const SInteger s0 = sbv_input_0;
SDouble s2;
s2 = sbv_fp_cast_integer_double(s0, BF_RNDN);
return s2;
}
== END: "toFP_Integer_ToDouble.c" ==================
== BEGIN: "toFP_Real_ToDouble.c" ================
/* File: "toFP_Real_ToDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
#include <float.h>
#if FLT_RADIX == 2 && LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 && LDBL_MIN_EXP == -1021
#define SBV_LDBL_EXP_BITS 11
#elif FLT_RADIX == 2 && (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 && LDBL_MIN_EXP == -16381
#define SBV_LDBL_EXP_BITS 15
#else
#error SBV C long-double conversions require binary64, x87 extended, or binary128 long double
#endif
#if BF_EXP_BITS_MAX < SBV_LDBL_EXP_BITS
#error SBV C long-double conversions exceed the LibBF exponent range
#endif
static SBV_CGEN_UNUSED bf_flags_t sbv_bf_long_double_flags(bf_rnd_t rnd)
{
return BF_FLAG_SUBNORMAL | bf_set_exp_bits(SBV_LDBL_EXP_BITS) | (bf_flags_t) rnd;
}
static SBV_CGEN_UNUSED void sbv_bf_set_long_double(bf_t *result, long double value)
{
int exponent, shift = 0, status = 0; bf_t chunk;
if (isnan(value)) { bf_set_nan(result); return; }
if (isinf(value)) { bf_set_inf(result, signbit(value) != 0); return; }
if (value == 0) { bf_set_zero(result, signbit(value) != 0); return; }
long double fraction = frexpl(fabsl(value), &exponent);
bf_init(result->ctx, &chunk); bf_set_zero(result, 0);
while (fraction != 0) {
fraction = ldexpl(fraction, 32);
const uint32_t bits = (uint32_t) fraction; fraction -= (long double) bits;
status |= bf_mul_2exp(result, 32, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
status |= bf_set_ui(&chunk, bits);
status |= bf_add(result, result, &chunk, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ); shift += 32;
}
status |= bf_mul_2exp(result, exponent - shift, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
bf_delete(&chunk); if (status & BF_ST_MEM_ERROR) abort();
if (signbit(value)) bf_neg(result);
}
static SBV_CGEN_UNUSED long double sbv_bf_get_long_double(bf_t *value, bf_rnd_t rnd)
{
if (bf_round(value, LDBL_MANT_DIG, sbv_bf_long_double_flags(rnd)) & BF_ST_MEM_ERROR) abort();
if (bf_is_nan(value)) return nanl("");
if (!bf_is_finite(value)) return value->sign ? -HUGE_VALL : HUGE_VALL;
if (bf_is_zero(value)) return value->sign ? -0.0L : 0.0L;
long double significand = 0;
const slimb_t base = (slimb_t) value->len * LIMB_BITS;
for (int i = 0; i < LDBL_MANT_DIG; ++i) {
const slimb_t bit = base - 1 - i;
const unsigned digit = bit < 0 ? 0 : (unsigned) ((value->tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1);
significand = significand * 2 + digit;
}
const long double result = ldexpl(significand, (int) value->expn - LDBL_MANT_DIG);
return value->sign ? -result : result;
}
static SBV_CGEN_UNUSED inline SDouble sbv_fp_cast_real_double(SReal a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; double result;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); sbv_bf_set_long_double(&x, a);
bf_round(&x, 53, BF_FLAG_SUBNORMAL | bf_set_exp_bits(11) | (bf_flags_t) rnd); bf_get_float64(&x, &result, rnd);
bf_delete(&x); bf_context_end(&ctx); return (SDouble) result;
}
SDouble toFP_Real_ToDouble(const SReal sbv_input_0)
{
const SReal s0 = sbv_input_0;
SDouble s2;
s2 = sbv_fp_cast_real_double(s0, BF_RNDN);
return s2;
}
== END: "toFP_Real_ToDouble.c" ==================
== BEGIN: "fromFP_Float_ToInt8.c" ================
/* File: "fromFP_Float_ToInt8.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SInt8 sbv_fp_cast_float_s8(SFloat a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord8 raw = (SWord8) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 8; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord8) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord8) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
SInt8 result; memcpy(&result, &raw, sizeof result); return result;
}
SInt8 fromFP_Float_ToInt8(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SInt8 s2;
s2 = sbv_fp_cast_float_s8(s0, BF_RNDN);
return s2;
}
== END: "fromFP_Float_ToInt8.c" ==================
== BEGIN: "fromFP_Float_ToInt16.c" ================
/* File: "fromFP_Float_ToInt16.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SInt16 sbv_fp_cast_float_s16(SFloat a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord16 raw = (SWord16) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 16; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord16) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord16) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
SInt16 result; memcpy(&result, &raw, sizeof result); return result;
}
SInt16 fromFP_Float_ToInt16(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SInt16 s2;
s2 = sbv_fp_cast_float_s16(s0, BF_RNDN);
return s2;
}
== END: "fromFP_Float_ToInt16.c" ==================
== BEGIN: "fromFP_Float_ToInt32.c" ================
/* File: "fromFP_Float_ToInt32.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SInt32 sbv_fp_cast_float_s32(SFloat a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord32 raw = (SWord32) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 32; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord32) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord32) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
SInt32 result; memcpy(&result, &raw, sizeof result); return result;
}
SInt32 fromFP_Float_ToInt32(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SInt32 s2;
s2 = sbv_fp_cast_float_s32(s0, BF_RNDN);
return s2;
}
== END: "fromFP_Float_ToInt32.c" ==================
== BEGIN: "fromFP_Float_ToInt64.c" ================
/* File: "fromFP_Float_ToInt64.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SInt64 sbv_fp_cast_float_s64(SFloat a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord64 raw = (SWord64) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 64; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord64) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord64) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
SInt64 result; memcpy(&result, &raw, sizeof result); return result;
}
SInt64 fromFP_Float_ToInt64(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SInt64 s2;
s2 = sbv_fp_cast_float_s64(s0, BF_RNDN);
return s2;
}
== END: "fromFP_Float_ToInt64.c" ==================
== BEGIN: "fromFP_Float_ToWord8.c" ================
/* File: "fromFP_Float_ToWord8.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SWord8 sbv_fp_cast_float_u8(SFloat a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord8 raw = (SWord8) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 8; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord8) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord8) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
return raw;
}
SWord8 fromFP_Float_ToWord8(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SWord8 s2;
s2 = sbv_fp_cast_float_u8(s0, BF_RNDN);
return s2;
}
== END: "fromFP_Float_ToWord8.c" ==================
== BEGIN: "fromFP_Float_ToWord16.c" ================
/* File: "fromFP_Float_ToWord16.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SWord16 sbv_fp_cast_float_u16(SFloat a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord16 raw = (SWord16) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 16; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord16) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord16) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
return raw;
}
SWord16 fromFP_Float_ToWord16(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SWord16 s2;
s2 = sbv_fp_cast_float_u16(s0, BF_RNDN);
return s2;
}
== END: "fromFP_Float_ToWord16.c" ==================
== BEGIN: "fromFP_Float_ToWord32.c" ================
/* File: "fromFP_Float_ToWord32.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SWord32 sbv_fp_cast_float_u32(SFloat a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord32 raw = (SWord32) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 32; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord32) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord32) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
return raw;
}
SWord32 fromFP_Float_ToWord32(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SWord32 s2;
s2 = sbv_fp_cast_float_u32(s0, BF_RNDN);
return s2;
}
== END: "fromFP_Float_ToWord32.c" ==================
== BEGIN: "fromFP_Float_ToWord64.c" ================
/* File: "fromFP_Float_ToWord64.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SWord64 sbv_fp_cast_float_u64(SFloat a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord64 raw = (SWord64) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 64; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord64) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord64) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
return raw;
}
SWord64 fromFP_Float_ToWord64(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SWord64 s2;
s2 = sbv_fp_cast_float_u64(s0, BF_RNDN);
return s2;
}
== END: "fromFP_Float_ToWord64.c" ==================
== BEGIN: "fromFP_Float_ToFloat.c" ================
/* File: "fromFP_Float_ToFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat fromFP_Float_ToFloat(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
return s0;
}
== END: "fromFP_Float_ToFloat.c" ==================
== BEGIN: "fromFP_Float_ToDouble.c" ================
/* File: "fromFP_Float_ToDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble fromFP_Float_ToDouble(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SDouble s2;
s2 = (SDouble) s0;
return s2;
}
== END: "fromFP_Float_ToDouble.c" ==================
== BEGIN: "fromFP_Float_ToInteger.c" ================
/* File: "fromFP_Float_ToInteger.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SInt64 sbv_fp_cast_float_integer(SFloat a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord64 raw = (SWord64) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 64; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord64) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord64) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
SInt64 result; memcpy(&result, &raw, sizeof result); return result;
}
SInteger fromFP_Float_ToInteger(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SInteger s2;
s2 = sbv_fp_cast_float_integer(s0, BF_RNDN);
return s2;
}
== END: "fromFP_Float_ToInteger.c" ==================
== BEGIN: "fromFP_Float_ToReal.c" ================
/* File: "fromFP_Float_ToReal.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
#include <float.h>
#if FLT_RADIX == 2 && LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 && LDBL_MIN_EXP == -1021
#define SBV_LDBL_EXP_BITS 11
#elif FLT_RADIX == 2 && (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 && LDBL_MIN_EXP == -16381
#define SBV_LDBL_EXP_BITS 15
#else
#error SBV C long-double conversions require binary64, x87 extended, or binary128 long double
#endif
#if BF_EXP_BITS_MAX < SBV_LDBL_EXP_BITS
#error SBV C long-double conversions exceed the LibBF exponent range
#endif
static SBV_CGEN_UNUSED bf_flags_t sbv_bf_long_double_flags(bf_rnd_t rnd)
{
return BF_FLAG_SUBNORMAL | bf_set_exp_bits(SBV_LDBL_EXP_BITS) | (bf_flags_t) rnd;
}
static SBV_CGEN_UNUSED void sbv_bf_set_long_double(bf_t *result, long double value)
{
int exponent, shift = 0, status = 0; bf_t chunk;
if (isnan(value)) { bf_set_nan(result); return; }
if (isinf(value)) { bf_set_inf(result, signbit(value) != 0); return; }
if (value == 0) { bf_set_zero(result, signbit(value) != 0); return; }
long double fraction = frexpl(fabsl(value), &exponent);
bf_init(result->ctx, &chunk); bf_set_zero(result, 0);
while (fraction != 0) {
fraction = ldexpl(fraction, 32);
const uint32_t bits = (uint32_t) fraction; fraction -= (long double) bits;
status |= bf_mul_2exp(result, 32, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
status |= bf_set_ui(&chunk, bits);
status |= bf_add(result, result, &chunk, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ); shift += 32;
}
status |= bf_mul_2exp(result, exponent - shift, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
bf_delete(&chunk); if (status & BF_ST_MEM_ERROR) abort();
if (signbit(value)) bf_neg(result);
}
static SBV_CGEN_UNUSED long double sbv_bf_get_long_double(bf_t *value, bf_rnd_t rnd)
{
if (bf_round(value, LDBL_MANT_DIG, sbv_bf_long_double_flags(rnd)) & BF_ST_MEM_ERROR) abort();
if (bf_is_nan(value)) return nanl("");
if (!bf_is_finite(value)) return value->sign ? -HUGE_VALL : HUGE_VALL;
if (bf_is_zero(value)) return value->sign ? -0.0L : 0.0L;
long double significand = 0;
const slimb_t base = (slimb_t) value->len * LIMB_BITS;
for (int i = 0; i < LDBL_MANT_DIG; ++i) {
const slimb_t bit = base - 1 - i;
const unsigned digit = bit < 0 ? 0 : (unsigned) ((value->tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1);
significand = significand * 2 + digit;
}
const long double result = ldexpl(significand, (int) value->expn - LDBL_MANT_DIG);
return value->sign ? -result : result;
}
static SBV_CGEN_UNUSED inline SReal sbv_fp_cast_float_real(SFloat a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; long double result;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a);
bf_round(&x, LDBL_MANT_DIG, sbv_bf_long_double_flags(rnd)); result = sbv_bf_get_long_double(&x, rnd);
bf_delete(&x); bf_context_end(&ctx); return (SReal) result;
}
SReal fromFP_Float_ToReal(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SReal s2;
s2 = sbv_fp_cast_float_real(s0, BF_RNDN);
return s2;
}
== END: "fromFP_Float_ToReal.c" ==================
== BEGIN: "fromFP_DoubleTo_Int8.c" ================
/* File: "fromFP_DoubleTo_Int8.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SInt8 sbv_fp_cast_double_s8(SDouble a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord8 raw = (SWord8) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 8; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord8) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord8) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
SInt8 result; memcpy(&result, &raw, sizeof result); return result;
}
SInt8 fromFP_DoubleTo_Int8(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SInt8 s2;
s2 = sbv_fp_cast_double_s8(s0, BF_RNDN);
return s2;
}
== END: "fromFP_DoubleTo_Int8.c" ==================
== BEGIN: "fromFP_DoubleTo_Int16.c" ================
/* File: "fromFP_DoubleTo_Int16.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SInt16 sbv_fp_cast_double_s16(SDouble a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord16 raw = (SWord16) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 16; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord16) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord16) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
SInt16 result; memcpy(&result, &raw, sizeof result); return result;
}
SInt16 fromFP_DoubleTo_Int16(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SInt16 s2;
s2 = sbv_fp_cast_double_s16(s0, BF_RNDN);
return s2;
}
== END: "fromFP_DoubleTo_Int16.c" ==================
== BEGIN: "fromFP_DoubleTo_Int32.c" ================
/* File: "fromFP_DoubleTo_Int32.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SInt32 sbv_fp_cast_double_s32(SDouble a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord32 raw = (SWord32) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 32; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord32) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord32) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
SInt32 result; memcpy(&result, &raw, sizeof result); return result;
}
SInt32 fromFP_DoubleTo_Int32(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SInt32 s2;
s2 = sbv_fp_cast_double_s32(s0, BF_RNDN);
return s2;
}
== END: "fromFP_DoubleTo_Int32.c" ==================
== BEGIN: "fromFP_DoubleTo_Int64.c" ================
/* File: "fromFP_DoubleTo_Int64.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SInt64 sbv_fp_cast_double_s64(SDouble a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord64 raw = (SWord64) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 64; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord64) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord64) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
SInt64 result; memcpy(&result, &raw, sizeof result); return result;
}
SInt64 fromFP_DoubleTo_Int64(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SInt64 s2;
s2 = sbv_fp_cast_double_s64(s0, BF_RNDN);
return s2;
}
== END: "fromFP_DoubleTo_Int64.c" ==================
== BEGIN: "fromFP_DoubleTo_Word8.c" ================
/* File: "fromFP_DoubleTo_Word8.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SWord8 sbv_fp_cast_double_u8(SDouble a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord8 raw = (SWord8) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 8; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord8) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord8) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
return raw;
}
SWord8 fromFP_DoubleTo_Word8(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SWord8 s2;
s2 = sbv_fp_cast_double_u8(s0, BF_RNDN);
return s2;
}
== END: "fromFP_DoubleTo_Word8.c" ==================
== BEGIN: "fromFP_DoubleTo_Word16.c" ================
/* File: "fromFP_DoubleTo_Word16.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SWord16 sbv_fp_cast_double_u16(SDouble a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord16 raw = (SWord16) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 16; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord16) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord16) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
return raw;
}
SWord16 fromFP_DoubleTo_Word16(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SWord16 s2;
s2 = sbv_fp_cast_double_u16(s0, BF_RNDN);
return s2;
}
== END: "fromFP_DoubleTo_Word16.c" ==================
== BEGIN: "fromFP_DoubleTo_Word32.c" ================
/* File: "fromFP_DoubleTo_Word32.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SWord32 sbv_fp_cast_double_u32(SDouble a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord32 raw = (SWord32) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 32; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord32) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord32) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
return raw;
}
SWord32 fromFP_DoubleTo_Word32(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SWord32 s2;
s2 = sbv_fp_cast_double_u32(s0, BF_RNDN);
return s2;
}
== END: "fromFP_DoubleTo_Word32.c" ==================
== BEGIN: "fromFP_DoubleTo_Word64.c" ================
/* File: "fromFP_DoubleTo_Word64.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SWord64 sbv_fp_cast_double_u64(SDouble a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord64 raw = (SWord64) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 64; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord64) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord64) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
return raw;
}
SWord64 fromFP_DoubleTo_Word64(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SWord64 s2;
s2 = sbv_fp_cast_double_u64(s0, BF_RNDN);
return s2;
}
== END: "fromFP_DoubleTo_Word64.c" ==================
== BEGIN: "fromFP_DoubleTo_Float.c" ================
/* File: "fromFP_DoubleTo_Float.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SFloat sbv_fp_cast_double_float(SDouble a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; double result;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a);
bf_round(&x, 24, BF_FLAG_SUBNORMAL | bf_set_exp_bits(8) | (bf_flags_t) rnd); bf_get_float64(&x, &result, rnd);
bf_delete(&x); bf_context_end(&ctx); return (SFloat) result;
}
SFloat fromFP_DoubleTo_Float(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SFloat s2;
s2 = sbv_fp_cast_double_float(s0, BF_RNDN);
return s2;
}
== END: "fromFP_DoubleTo_Float.c" ==================
== BEGIN: "fromFP_DoubleTo_Double.c" ================
/* File: "fromFP_DoubleTo_Double.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble fromFP_DoubleTo_Double(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
return s0;
}
== END: "fromFP_DoubleTo_Double.c" ==================
== BEGIN: "fromFP_DoubleTo_Integer.c" ================
/* File: "fromFP_DoubleTo_Integer.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
static SBV_CGEN_UNUSED inline SInt64 sbv_fp_cast_double_integer(SDouble a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; SWord64 raw = (SWord64) 0; limb_t i;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a); bf_rint(&x, rnd);
if (bf_is_finite(&x) && !bf_is_zero(&x)) {
const slimb_t base = (slimb_t) x.len * LIMB_BITS;
for (i = 0; i < 64; ++i) {
const slimb_t bit = (slimb_t) i - x.expn + base;
if (bit >= 0 && bit < base) { raw = (SWord64) ((uint64_t) raw | ((uint64_t) (((x.tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1) != 0) << (i))); }
}
if (x.sign) raw = (SWord64) (~(uint64_t) raw + UINT64_C(1));
}
bf_delete(&x); bf_context_end(&ctx);
SInt64 result; memcpy(&result, &raw, sizeof result); return result;
}
SInteger fromFP_DoubleTo_Integer(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SInteger s2;
s2 = sbv_fp_cast_double_integer(s0, BF_RNDN);
return s2;
}
== END: "fromFP_DoubleTo_Integer.c" ==================
== BEGIN: "fromFP_DoubleTo_Real.c" ================
/* File: "fromFP_DoubleTo_Real.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
/* LibBF-backed arbitrary floating-point runtime. */
#ifndef SBV_CGEN_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define SBV_CGEN_UNUSED __attribute__((unused))
#else
#define SBV_CGEN_UNUSED
#endif
#endif
static SBV_CGEN_UNUSED inline bf_rnd_t sbv_bf_rounding_mode(int mode)
{
switch (mode) {
case 0: return BF_RNDN;
case 1: return BF_RNDNA;
case 2: return BF_RNDU;
case 3: return BF_RNDD;
case 4: return BF_RNDZ;
default: abort();
}
}
static SBV_CGEN_UNUSED void *sbv_bf_realloc(void *opaque, void *ptr, size_t size)
{
(void) opaque;
return realloc(ptr, size);
}
#include <float.h>
#if FLT_RADIX == 2 && LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 && LDBL_MIN_EXP == -1021
#define SBV_LDBL_EXP_BITS 11
#elif FLT_RADIX == 2 && (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 && LDBL_MIN_EXP == -16381
#define SBV_LDBL_EXP_BITS 15
#else
#error SBV C long-double conversions require binary64, x87 extended, or binary128 long double
#endif
#if BF_EXP_BITS_MAX < SBV_LDBL_EXP_BITS
#error SBV C long-double conversions exceed the LibBF exponent range
#endif
static SBV_CGEN_UNUSED bf_flags_t sbv_bf_long_double_flags(bf_rnd_t rnd)
{
return BF_FLAG_SUBNORMAL | bf_set_exp_bits(SBV_LDBL_EXP_BITS) | (bf_flags_t) rnd;
}
static SBV_CGEN_UNUSED void sbv_bf_set_long_double(bf_t *result, long double value)
{
int exponent, shift = 0, status = 0; bf_t chunk;
if (isnan(value)) { bf_set_nan(result); return; }
if (isinf(value)) { bf_set_inf(result, signbit(value) != 0); return; }
if (value == 0) { bf_set_zero(result, signbit(value) != 0); return; }
long double fraction = frexpl(fabsl(value), &exponent);
bf_init(result->ctx, &chunk); bf_set_zero(result, 0);
while (fraction != 0) {
fraction = ldexpl(fraction, 32);
const uint32_t bits = (uint32_t) fraction; fraction -= (long double) bits;
status |= bf_mul_2exp(result, 32, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
status |= bf_set_ui(&chunk, bits);
status |= bf_add(result, result, &chunk, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ); shift += 32;
}
status |= bf_mul_2exp(result, exponent - shift, BF_PREC_INF, BF_FLAG_EXT_EXP | BF_RNDZ);
bf_delete(&chunk); if (status & BF_ST_MEM_ERROR) abort();
if (signbit(value)) bf_neg(result);
}
static SBV_CGEN_UNUSED long double sbv_bf_get_long_double(bf_t *value, bf_rnd_t rnd)
{
if (bf_round(value, LDBL_MANT_DIG, sbv_bf_long_double_flags(rnd)) & BF_ST_MEM_ERROR) abort();
if (bf_is_nan(value)) return nanl("");
if (!bf_is_finite(value)) return value->sign ? -HUGE_VALL : HUGE_VALL;
if (bf_is_zero(value)) return value->sign ? -0.0L : 0.0L;
long double significand = 0;
const slimb_t base = (slimb_t) value->len * LIMB_BITS;
for (int i = 0; i < LDBL_MANT_DIG; ++i) {
const slimb_t bit = base - 1 - i;
const unsigned digit = bit < 0 ? 0 : (unsigned) ((value->tab[bit / LIMB_BITS] >> (bit % LIMB_BITS)) & 1);
significand = significand * 2 + digit;
}
const long double result = ldexpl(significand, (int) value->expn - LDBL_MANT_DIG);
return value->sign ? -result : result;
}
static SBV_CGEN_UNUSED inline SReal sbv_fp_cast_double_real(SDouble a, bf_rnd_t rnd)
{
bf_context_t ctx; bf_t x; long double result;
bf_context_init(&ctx, sbv_bf_realloc, NULL); bf_init(&ctx, &x); bf_set_float64(&x, (double) a);
bf_round(&x, LDBL_MANT_DIG, sbv_bf_long_double_flags(rnd)); result = sbv_bf_get_long_double(&x, rnd);
bf_delete(&x); bf_context_end(&ctx); return (SReal) result;
}
SReal fromFP_DoubleTo_Real(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SReal s2;
s2 = sbv_fp_cast_double_real(s0, BF_RNDN);
return s2;
}
== END: "fromFP_DoubleTo_Real.c" ==================
== BEGIN: "fromFP_SWord32_SFloat.c" ================
/* File: "fromFP_SWord32_SFloat.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat fromFP_SWord32_SFloat(const SWord32 sbv_input_0)
{
const SWord32 s0 = sbv_input_0;
SFloat s1;
memcpy(&s1, &s0, sizeof(SFloat));
return s1;
}
== END: "fromFP_SWord32_SFloat.c" ==================
== BEGIN: "fromFP_SWord64_SDouble.c" ================
/* File: "fromFP_SWord64_SDouble.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble fromFP_SWord64_SDouble(const SWord64 sbv_input_0)
{
const SWord64 s0 = sbv_input_0;
SDouble s1;
memcpy(&s1, &s0, sizeof(SDouble));
return s1;
}
== END: "fromFP_SWord64_SDouble.c" ==================
== BEGIN: "fromFP_SFloat_SWord32.c" ================
/* File: "fromFP_SFloat_SWord32.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SWord32 fromFP_SFloat_SWord32(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SWord32 s1;
memcpy(&s1, &s0, sizeof(SWord32));
return s1;
}
== END: "fromFP_SFloat_SWord32.c" ==================
== BEGIN: "fromFP_SDouble_SWord64.c" ================
/* File: "fromFP_SDouble_SWord64.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SWord64 fromFP_SDouble_SWord64(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SWord64 s1;
memcpy(&s1, &s0, sizeof(SWord64));
return s1;
}
== END: "fromFP_SDouble_SWord64.c" ==================
== BEGIN: "f_FP_Abs.c" ================
/* File: "f_FP_Abs.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat f_FP_Abs(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SFloat s1;
s1 = fabsf(s0);
return s1;
}
== END: "f_FP_Abs.c" ==================
== BEGIN: "d_FP_Abs.c" ================
/* File: "d_FP_Abs.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble d_FP_Abs(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SDouble s1;
s1 = fabs(s0);
return s1;
}
== END: "d_FP_Abs.c" ==================
== BEGIN: "f_FP_Neg.c" ================
/* File: "f_FP_Neg.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat f_FP_Neg(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SFloat s1;
s1 = (- s0);
return s1;
}
== END: "f_FP_Neg.c" ==================
== BEGIN: "d_FP_Neg.c" ================
/* File: "d_FP_Neg.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble d_FP_Neg(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SDouble s1;
s1 = (- s0);
return s1;
}
== END: "d_FP_Neg.c" ==================
== BEGIN: "f_FP_Add.c" ================
/* File: "f_FP_Add.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat f_FP_Add(const SFloat sbv_input_0, const SFloat sbv_input_1)
{
const SFloat s0 = sbv_input_0;
const SFloat s1 = sbv_input_1;
SFloat s3;
s3 = s0 + s1;
return s3;
}
== END: "f_FP_Add.c" ==================
== BEGIN: "d_FP_Add.c" ================
/* File: "d_FP_Add.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble d_FP_Add(const SDouble sbv_input_0,
const SDouble sbv_input_1)
{
const SDouble s0 = sbv_input_0;
const SDouble s1 = sbv_input_1;
SDouble s3;
s3 = s0 + s1;
return s3;
}
== END: "d_FP_Add.c" ==================
== BEGIN: "f_FP_Sub.c" ================
/* File: "f_FP_Sub.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat f_FP_Sub(const SFloat sbv_input_0, const SFloat sbv_input_1)
{
const SFloat s0 = sbv_input_0;
const SFloat s1 = sbv_input_1;
SFloat s3;
s3 = s0 - s1;
return s3;
}
== END: "f_FP_Sub.c" ==================
== BEGIN: "d_FP_Sub.c" ================
/* File: "d_FP_Sub.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble d_FP_Sub(const SDouble sbv_input_0,
const SDouble sbv_input_1)
{
const SDouble s0 = sbv_input_0;
const SDouble s1 = sbv_input_1;
SDouble s3;
s3 = s0 - s1;
return s3;
}
== END: "d_FP_Sub.c" ==================
== BEGIN: "f_FP_Mul.c" ================
/* File: "f_FP_Mul.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat f_FP_Mul(const SFloat sbv_input_0, const SFloat sbv_input_1)
{
const SFloat s0 = sbv_input_0;
const SFloat s1 = sbv_input_1;
SFloat s3;
s3 = s0 * s1;
return s3;
}
== END: "f_FP_Mul.c" ==================
== BEGIN: "d_FP_Mul.c" ================
/* File: "d_FP_Mul.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble d_FP_Mul(const SDouble sbv_input_0,
const SDouble sbv_input_1)
{
const SDouble s0 = sbv_input_0;
const SDouble s1 = sbv_input_1;
SDouble s3;
s3 = s0 * s1;
return s3;
}
== END: "d_FP_Mul.c" ==================
== BEGIN: "f_FP_Div.c" ================
/* File: "f_FP_Div.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat f_FP_Div(const SFloat sbv_input_0, const SFloat sbv_input_1)
{
const SFloat s0 = sbv_input_0;
const SFloat s1 = sbv_input_1;
SFloat s3;
s3 = s0 / s1;
return s3;
}
== END: "f_FP_Div.c" ==================
== BEGIN: "d_FP_Div.c" ================
/* File: "d_FP_Div.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble d_FP_Div(const SDouble sbv_input_0,
const SDouble sbv_input_1)
{
const SDouble s0 = sbv_input_0;
const SDouble s1 = sbv_input_1;
SDouble s3;
s3 = s0 / s1;
return s3;
}
== END: "d_FP_Div.c" ==================
== BEGIN: "f_FP_FMA.c" ================
/* File: "f_FP_FMA.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat f_FP_FMA(const SFloat sbv_input_0, const SFloat sbv_input_1,
const SFloat sbv_input_2)
{
const SFloat s0 = sbv_input_0;
const SFloat s1 = sbv_input_1;
const SFloat s2 = sbv_input_2;
SFloat s4;
s4 = fmaf(s0, s1, s2);
return s4;
}
== END: "f_FP_FMA.c" ==================
== BEGIN: "d_FP_FMA.c" ================
/* File: "d_FP_FMA.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble d_FP_FMA(const SDouble sbv_input_0,
const SDouble sbv_input_1, const SDouble sbv_input_2)
{
const SDouble s0 = sbv_input_0;
const SDouble s1 = sbv_input_1;
const SDouble s2 = sbv_input_2;
SDouble s4;
s4 = fma(s0, s1, s2);
return s4;
}
== END: "d_FP_FMA.c" ==================
== BEGIN: "f_FP_Sqrt.c" ================
/* File: "f_FP_Sqrt.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat f_FP_Sqrt(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SFloat s2;
s2 = sqrtf(s0);
return s2;
}
== END: "f_FP_Sqrt.c" ==================
== BEGIN: "d_FP_Sqrt.c" ================
/* File: "d_FP_Sqrt.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble d_FP_Sqrt(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SDouble s2;
s2 = sqrt(s0);
return s2;
}
== END: "d_FP_Sqrt.c" ==================
== BEGIN: "f_FP_Rem.c" ================
/* File: "f_FP_Rem.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat f_FP_Rem(const SFloat sbv_input_0, const SFloat sbv_input_1)
{
const SFloat s0 = sbv_input_0;
const SFloat s1 = sbv_input_1;
SFloat s2;
s2 = remainderf(s0, s1);
return s2;
}
== END: "f_FP_Rem.c" ==================
== BEGIN: "d_FP_Rem.c" ================
/* File: "d_FP_Rem.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble d_FP_Rem(const SDouble sbv_input_0,
const SDouble sbv_input_1)
{
const SDouble s0 = sbv_input_0;
const SDouble s1 = sbv_input_1;
SDouble s2;
s2 = remainder(s0, s1);
return s2;
}
== END: "d_FP_Rem.c" ==================
== BEGIN: "f_FP_RoundToIntegral.c" ================
/* File: "f_FP_RoundToIntegral.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat f_FP_RoundToIntegral(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SFloat s2;
s2 = rintf(s0);
return s2;
}
== END: "f_FP_RoundToIntegral.c" ==================
== BEGIN: "d_FP_RoundToIntegral.c" ================
/* File: "d_FP_RoundToIntegral.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble d_FP_RoundToIntegral(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SDouble s2;
s2 = rint(s0);
return s2;
}
== END: "d_FP_RoundToIntegral.c" ==================
== BEGIN: "f_FP_Min.c" ================
/* File: "f_FP_Min.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat f_FP_Min(const SFloat sbv_input_0, const SFloat sbv_input_1)
{
const SFloat s0 = sbv_input_0;
const SFloat s1 = sbv_input_1;
SFloat s2;
s2 = ((FP_ZERO == fpclassify(s0)) && (FP_ZERO == fpclassify(s1)) && (signbit(s0) != signbit(s1))) ? 0x0p+0F /* 0.0F */ : fminf(s0,
s1);
return s2;
}
== END: "f_FP_Min.c" ==================
== BEGIN: "d_FP_Min.c" ================
/* File: "d_FP_Min.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble d_FP_Min(const SDouble sbv_input_0,
const SDouble sbv_input_1)
{
const SDouble s0 = sbv_input_0;
const SDouble s1 = sbv_input_1;
SDouble s2;
s2 = ((FP_ZERO == fpclassify(s0)) && (FP_ZERO == fpclassify(s1)) && (signbit(s0) != signbit(s1))) ? 0x0p+0 /* 0.0 */ : fmin(s0,
s1);
return s2;
}
== END: "d_FP_Min.c" ==================
== BEGIN: "f_FP_Max.c" ================
/* File: "f_FP_Max.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SFloat f_FP_Max(const SFloat sbv_input_0, const SFloat sbv_input_1)
{
const SFloat s0 = sbv_input_0;
const SFloat s1 = sbv_input_1;
SFloat s2;
s2 = ((FP_ZERO == fpclassify(s0)) && (FP_ZERO == fpclassify(s1)) && (signbit(s0) != signbit(s1))) ? 0x0p+0F /* 0.0F */ : fmaxf(s0,
s1);
return s2;
}
== END: "f_FP_Max.c" ==================
== BEGIN: "d_FP_Max.c" ================
/* File: "d_FP_Max.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SDouble d_FP_Max(const SDouble sbv_input_0,
const SDouble sbv_input_1)
{
const SDouble s0 = sbv_input_0;
const SDouble s1 = sbv_input_1;
SDouble s2;
s2 = ((FP_ZERO == fpclassify(s0)) && (FP_ZERO == fpclassify(s1)) && (signbit(s0) != signbit(s1))) ? 0x0p+0 /* 0.0 */ : fmax(s0,
s1);
return s2;
}
== END: "d_FP_Max.c" ==================
== BEGIN: "f_FP_IsEqualObject.c" ================
/* File: "f_FP_IsEqualObject.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool f_FP_IsEqualObject(const SFloat sbv_input_0,
const SFloat sbv_input_1)
{
const SFloat s0 = sbv_input_0;
const SFloat s1 = sbv_input_1;
SBool s2;
s2 = isnan(s0) ? isnan(s1) : (signbit(s0) && (s0 == 0)) ? (signbit(s1) && (s1 == 0)) : (signbit(s1) && (s1 == 0)) ? (signbit(s0) && (s0 == 0)) : (s0 == s1);
return s2;
}
== END: "f_FP_IsEqualObject.c" ==================
== BEGIN: "d_FP_IsEqualObject.c" ================
/* File: "d_FP_IsEqualObject.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool d_FP_IsEqualObject(const SDouble sbv_input_0,
const SDouble sbv_input_1)
{
const SDouble s0 = sbv_input_0;
const SDouble s1 = sbv_input_1;
SBool s2;
s2 = isnan(s0) ? isnan(s1) : (signbit(s0) && (s0 == 0)) ? (signbit(s1) && (s1 == 0)) : (signbit(s1) && (s1 == 0)) ? (signbit(s0) && (s0 == 0)) : (s0 == s1);
return s2;
}
== END: "d_FP_IsEqualObject.c" ==================
== BEGIN: "f_FP_IsNormal.c" ================
/* File: "f_FP_IsNormal.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool f_FP_IsNormal(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SBool s1;
s1 = isnormal(s0);
return s1;
}
== END: "f_FP_IsNormal.c" ==================
== BEGIN: "d_FP_IsNormal.c" ================
/* File: "d_FP_IsNormal.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool d_FP_IsNormal(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SBool s1;
s1 = isnormal(s0);
return s1;
}
== END: "d_FP_IsNormal.c" ==================
== BEGIN: "f_FP_IsZero.c" ================
/* File: "f_FP_IsZero.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool f_FP_IsZero(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SBool s1;
s1 = FP_ZERO == fpclassify(s0);
return s1;
}
== END: "f_FP_IsZero.c" ==================
== BEGIN: "d_FP_IsZero.c" ================
/* File: "d_FP_IsZero.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool d_FP_IsZero(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SBool s1;
s1 = FP_ZERO == fpclassify(s0);
return s1;
}
== END: "d_FP_IsZero.c" ==================
== BEGIN: "f_FP_IsSubnormal.c" ================
/* File: "f_FP_IsSubnormal.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool f_FP_IsSubnormal(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SBool s1;
s1 = FP_SUBNORMAL == fpclassify(s0);
return s1;
}
== END: "f_FP_IsSubnormal.c" ==================
== BEGIN: "d_FP_IsSubnormal.c" ================
/* File: "d_FP_IsSubnormal.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool d_FP_IsSubnormal(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SBool s1;
s1 = FP_SUBNORMAL == fpclassify(s0);
return s1;
}
== END: "d_FP_IsSubnormal.c" ==================
== BEGIN: "f_FP_IsInfinite.c" ================
/* File: "f_FP_IsInfinite.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool f_FP_IsInfinite(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SBool s1;
s1 = isinf(s0);
return s1;
}
== END: "f_FP_IsInfinite.c" ==================
== BEGIN: "d_FP_IsInfinite.c" ================
/* File: "d_FP_IsInfinite.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool d_FP_IsInfinite(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SBool s1;
s1 = isinf(s0);
return s1;
}
== END: "d_FP_IsInfinite.c" ==================
== BEGIN: "f_FP_IsNaN.c" ================
/* File: "f_FP_IsNaN.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool f_FP_IsNaN(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SBool s1;
s1 = isnan(s0);
return s1;
}
== END: "f_FP_IsNaN.c" ==================
== BEGIN: "d_FP_IsNaN.c" ================
/* File: "d_FP_IsNaN.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool d_FP_IsNaN(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SBool s1;
s1 = isnan(s0);
return s1;
}
== END: "d_FP_IsNaN.c" ==================
== BEGIN: "f_FP_IsNegative.c" ================
/* File: "f_FP_IsNegative.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool f_FP_IsNegative(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SBool s1;
s1 = !isnan(s0) && signbit(s0);
return s1;
}
== END: "f_FP_IsNegative.c" ==================
== BEGIN: "d_FP_IsNegative.c" ================
/* File: "d_FP_IsNegative.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool d_FP_IsNegative(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SBool s1;
s1 = !isnan(s0) && signbit(s0);
return s1;
}
== END: "d_FP_IsNegative.c" ==================
== BEGIN: "f_FP_IsPositive.c" ================
/* File: "f_FP_IsPositive.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool f_FP_IsPositive(const SFloat sbv_input_0)
{
const SFloat s0 = sbv_input_0;
SBool s1;
s1 = !isnan(s0) && !signbit(s0);
return s1;
}
== END: "f_FP_IsPositive.c" ==================
== BEGIN: "d_FP_IsPositive.c" ================
/* File: "d_FP_IsPositive.c". Automatically generated by SBV. Do not edit! */
#include "floatCodeGen.h"
#include <libbf.h>
/* Preserve separate SBV rounding steps; explicit fma calls remain fused. */
#if defined(__clang__)
#pragma STDC FP_CONTRACT OFF
#endif
SBool d_FP_IsPositive(const SDouble sbv_input_0)
{
const SDouble s0 = sbv_input_0;
SBool s1;
s1 = !isnan(s0) && !signbit(s0);
return s1;
}
== END: "d_FP_IsPositive.c" ==================
== BEGIN: "floatCodeGen.h" ================
/* Header file for floatCodeGen. Automatically generated by SBV. Do not edit! */
#ifndef SBV_GENERATED_floatCodeGen_HEADER_INCLUDED
#define SBV_GENERATED_floatCodeGen_HEADER_INCLUDED
#if defined(__FAST_MATH__) || (defined(__FINITE_MATH_ONLY__) && __FINITE_MATH_ONLY__ > 0)
#error "SBV-generated C requires IEEE floating-point semantics; disable fast-math and finite-math-only."
#endif
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <float.h>
#if FLT_EVAL_METHOD != 0
#error "SBV-generated C requires FLT_EVAL_METHOD == 0; indeterminate or excess-precision floating evaluation is unsupported."
#endif
/* Floating-point calling convention:
* Enter generated code in FE_TONEAREST (round-to-nearest, ties-to-even).
* Callbacks must preserve this mode before returning or re-entering.
* Generated code does not check or change the hardware rounding mode.
* Custom builds must disable implicit FP contraction, including at LTO link time.
*/
/* The boolean type */
typedef bool SBool;
/* The float type */
typedef float SFloat;
/* The double type */
typedef double SDouble;
/* Unsigned bit-vectors */
typedef uint8_t SWord8;
typedef uint16_t SWord16;
typedef uint32_t SWord32;
typedef uint64_t SWord64;
/* Signed bit-vectors */
typedef int8_t SInt8;
typedef int16_t SInt16;
typedef int32_t SInt32;
typedef int64_t SInt64;
/* User requested mapping for SInteger. */
/* NB. Loss of precision: Target type is subject to modular arithmetic. */
typedef SInt64 SInteger;
/* User requested mapping for SReal. */
/* NB. Loss of precision: Target type is subject to rounding. */
typedef long double SReal;
/* IEEE-754 rounding modes. */
#ifndef SBV_ROUNDING_MODE_DEFINED
#define SBV_ROUNDING_MODE_DEFINED
typedef enum { SBV_RM_RNE = 0, SBV_RM_RNA = 1, SBV_RM_RTP = 2, SBV_RM_RTN = 3, SBV_RM_RTZ = 4 } RoundingMode;
#endif
/* Entry point prototypes: */
SFloat toFP_Int8_ToFloat(const SInt8 a);
SFloat toFP_Int16_ToFloat(const SInt16 a);
SFloat toFP_Int32_ToFloat(const SInt32 a);
SFloat toFP_Int64_ToFloat(const SInt64 a);
SFloat toFP_Word8_ToFloat(const SWord8 a);
SFloat toFP_Word16_ToFloat(const SWord16 a);
SFloat toFP_Word32_ToFloat(const SWord32 a);
SFloat toFP_Word64_ToFloat(const SWord64 a);
SFloat toFP_Float_ToFloat(const SFloat a);
SFloat toFP_Double_ToFloat(const SDouble a);
SFloat toFP_Integer_ToFloat(const SInteger a);
SFloat toFP_Real_ToFloat(const SReal a);
SDouble toFP_Int8_ToDouble(const SInt8 a);
SDouble toFP_Int16_ToDouble(const SInt16 a);
SDouble toFP_Int32_ToDouble(const SInt32 a);
SDouble toFP_Int64_ToDouble(const SInt64 a);
SDouble toFP_Word8_ToDouble(const SWord8 a);
SDouble toFP_Word16_ToDouble(const SWord16 a);
SDouble toFP_Word32_ToDouble(const SWord32 a);
SDouble toFP_Word64_ToDouble(const SWord64 a);
SDouble toFP_Float_ToDouble(const SFloat a);
SDouble toFP_Double_ToDouble(const SDouble a);
SDouble toFP_Integer_ToDouble(const SInteger a);
SDouble toFP_Real_ToDouble(const SReal a);
SInt8 fromFP_Float_ToInt8(const SFloat a);
SInt16 fromFP_Float_ToInt16(const SFloat a);
SInt32 fromFP_Float_ToInt32(const SFloat a);
SInt64 fromFP_Float_ToInt64(const SFloat a);
SWord8 fromFP_Float_ToWord8(const SFloat a);
SWord16 fromFP_Float_ToWord16(const SFloat a);
SWord32 fromFP_Float_ToWord32(const SFloat a);
SWord64 fromFP_Float_ToWord64(const SFloat a);
SFloat fromFP_Float_ToFloat(const SFloat a);
SDouble fromFP_Float_ToDouble(const SFloat a);
SInteger fromFP_Float_ToInteger(const SFloat a);
SReal fromFP_Float_ToReal(const SFloat a);
SInt8 fromFP_DoubleTo_Int8(const SDouble a);
SInt16 fromFP_DoubleTo_Int16(const SDouble a);
SInt32 fromFP_DoubleTo_Int32(const SDouble a);
SInt64 fromFP_DoubleTo_Int64(const SDouble a);
SWord8 fromFP_DoubleTo_Word8(const SDouble a);
SWord16 fromFP_DoubleTo_Word16(const SDouble a);
SWord32 fromFP_DoubleTo_Word32(const SDouble a);
SWord64 fromFP_DoubleTo_Word64(const SDouble a);
SFloat fromFP_DoubleTo_Float(const SDouble a);
SDouble fromFP_DoubleTo_Double(const SDouble a);
SInteger fromFP_DoubleTo_Integer(const SDouble a);
SReal fromFP_DoubleTo_Real(const SDouble a);
SFloat fromFP_SWord32_SFloat(const SWord32 a);
SDouble fromFP_SWord64_SDouble(const SWord64 a);
SWord32 fromFP_SFloat_SWord32(const SFloat a);
SWord64 fromFP_SDouble_SWord64(const SDouble a);
SFloat f_FP_Abs(const SFloat a);
SDouble d_FP_Abs(const SDouble a);
SFloat f_FP_Neg(const SFloat a);
SDouble d_FP_Neg(const SDouble a);
SFloat f_FP_Add(const SFloat a, const SFloat b);
SDouble d_FP_Add(const SDouble a, const SDouble b);
SFloat f_FP_Sub(const SFloat a, const SFloat b);
SDouble d_FP_Sub(const SDouble a, const SDouble b);
SFloat f_FP_Mul(const SFloat a, const SFloat b);
SDouble d_FP_Mul(const SDouble a, const SDouble b);
SFloat f_FP_Div(const SFloat a, const SFloat b);
SDouble d_FP_Div(const SDouble a, const SDouble b);
SFloat f_FP_FMA(const SFloat a, const SFloat b, const SFloat c);
SDouble d_FP_FMA(const SDouble a, const SDouble b,
const SDouble c);
SFloat f_FP_Sqrt(const SFloat a);
SDouble d_FP_Sqrt(const SDouble a);
SFloat f_FP_Rem(const SFloat a, const SFloat b);
SDouble d_FP_Rem(const SDouble a, const SDouble b);
SFloat f_FP_RoundToIntegral(const SFloat a);
SDouble d_FP_RoundToIntegral(const SDouble a);
SFloat f_FP_Min(const SFloat a, const SFloat b);
SDouble d_FP_Min(const SDouble a, const SDouble b);
SFloat f_FP_Max(const SFloat a, const SFloat b);
SDouble d_FP_Max(const SDouble a, const SDouble b);
SBool f_FP_IsEqualObject(const SFloat a, const SFloat b);
SBool d_FP_IsEqualObject(const SDouble a, const SDouble b);
SBool f_FP_IsNormal(const SFloat a);
SBool d_FP_IsNormal(const SDouble a);
SBool f_FP_IsZero(const SFloat a);
SBool d_FP_IsZero(const SDouble a);
SBool f_FP_IsSubnormal(const SFloat a);
SBool d_FP_IsSubnormal(const SDouble a);
SBool f_FP_IsInfinite(const SFloat a);
SBool d_FP_IsInfinite(const SDouble a);
SBool f_FP_IsNaN(const SFloat a);
SBool d_FP_IsNaN(const SDouble a);
SBool f_FP_IsNegative(const SFloat a);
SBool d_FP_IsNegative(const SDouble a);
SBool f_FP_IsPositive(const SFloat a);
SBool d_FP_IsPositive(const SDouble a);
#endif /* SBV_GENERATED_floatCodeGen_HEADER_INCLUDED */
== END: "floatCodeGen.h" ==================
== BEGIN: "floatCodeGen_driver.c" ================
/* Example driver program for floatCodeGen. */
/* Automatically generated by SBV. Edit as you see fit! */
#include <stdio.h>
#include "floatCodeGen.h"
#include <libbf.h>
void toFP_Int8_ToFloat_driver(void)
{
const SFloat sbv_result = toFP_Int8_ToFloat(42);
printf("toFP_Int8_ToFloat(42) = %a\n", sbv_result);
}
void toFP_Int16_ToFloat_driver(void)
{
const SFloat sbv_result = toFP_Int16_ToFloat(0x002a);
printf("toFP_Int16_ToFloat(0x002a) = %a\n", sbv_result);
}
void toFP_Int32_ToFloat_driver(void)
{
const SFloat sbv_result = toFP_Int32_ToFloat(0x0000002aL);
printf("toFP_Int32_ToFloat(0x0000002aL) = %a\n", sbv_result);
}
void toFP_Int64_ToFloat_driver(void)
{
const SFloat sbv_result = toFP_Int64_ToFloat(0x000000000000002aLL);
printf("toFP_Int64_ToFloat(0x000000000000002aLL) = %a\n", sbv_result);
}
void toFP_Word8_ToFloat_driver(void)
{
const SFloat sbv_result = toFP_Word8_ToFloat(42);
printf("toFP_Word8_ToFloat(42) = %a\n", sbv_result);
}
void toFP_Word16_ToFloat_driver(void)
{
const SFloat sbv_result = toFP_Word16_ToFloat(0x002aU);
printf("toFP_Word16_ToFloat(0x002aU) = %a\n", sbv_result);
}
void toFP_Word32_ToFloat_driver(void)
{
const SFloat sbv_result = toFP_Word32_ToFloat(0x0000002aUL);
printf("toFP_Word32_ToFloat(0x0000002aUL) = %a\n", sbv_result);
}
void toFP_Word64_ToFloat_driver(void)
{
const SFloat sbv_result = toFP_Word64_ToFloat(0x000000000000002aULL);
printf("toFP_Word64_ToFloat(0x000000000000002aULL) = %a\n", sbv_result);
}
void toFP_Float_ToFloat_driver(void)
{
const SFloat sbv_result = toFP_Float_ToFloat(0x1.5p5F /* 42.0F */);
printf("toFP_Float_ToFloat(0x1.5p5F /* 42.0F */) = %a\n", sbv_result);
}
void toFP_Double_ToFloat_driver(void)
{
const SFloat sbv_result = toFP_Double_ToFloat(0x1.5p5 /* 42.0 */);
printf("toFP_Double_ToFloat(0x1.5p5 /* 42.0 */) = %a\n", sbv_result);
}
void toFP_Integer_ToFloat_driver(void)
{
const SFloat sbv_result = toFP_Integer_ToFloat(0x000000000000002aLL);
printf("toFP_Integer_ToFloat(0x000000000000002aLL) = %a\n", sbv_result);
}
void toFP_Real_ToFloat_driver(void)
{
const SFloat sbv_result = toFP_Real_ToFloat(42.0L);
printf("toFP_Real_ToFloat(42.0L) = %a\n", sbv_result);
}
void toFP_Int8_ToDouble_driver(void)
{
const SDouble sbv_result = toFP_Int8_ToDouble(42);
printf("toFP_Int8_ToDouble(42) = %a\n", sbv_result);
}
void toFP_Int16_ToDouble_driver(void)
{
const SDouble sbv_result = toFP_Int16_ToDouble(0x002a);
printf("toFP_Int16_ToDouble(0x002a) = %a\n", sbv_result);
}
void toFP_Int32_ToDouble_driver(void)
{
const SDouble sbv_result = toFP_Int32_ToDouble(0x0000002aL);
printf("toFP_Int32_ToDouble(0x0000002aL) = %a\n", sbv_result);
}
void toFP_Int64_ToDouble_driver(void)
{
const SDouble sbv_result = toFP_Int64_ToDouble(0x000000000000002aLL);
printf("toFP_Int64_ToDouble(0x000000000000002aLL) = %a\n", sbv_result);
}
void toFP_Word8_ToDouble_driver(void)
{
const SDouble sbv_result = toFP_Word8_ToDouble(42);
printf("toFP_Word8_ToDouble(42) = %a\n", sbv_result);
}
void toFP_Word16_ToDouble_driver(void)
{
const SDouble sbv_result = toFP_Word16_ToDouble(0x002aU);
printf("toFP_Word16_ToDouble(0x002aU) = %a\n", sbv_result);
}
void toFP_Word32_ToDouble_driver(void)
{
const SDouble sbv_result = toFP_Word32_ToDouble(0x0000002aUL);
printf("toFP_Word32_ToDouble(0x0000002aUL) = %a\n", sbv_result);
}
void toFP_Word64_ToDouble_driver(void)
{
const SDouble sbv_result = toFP_Word64_ToDouble(0x000000000000002aULL);
printf("toFP_Word64_ToDouble(0x000000000000002aULL) = %a\n", sbv_result);
}
void toFP_Float_ToDouble_driver(void)
{
const SDouble sbv_result = toFP_Float_ToDouble(0x1.5p5F /* 42.0F */);
printf("toFP_Float_ToDouble(0x1.5p5F /* 42.0F */) = %a\n", sbv_result);
}
void toFP_Double_ToDouble_driver(void)
{
const SDouble sbv_result = toFP_Double_ToDouble(0x1.5p5 /* 42.0 */);
printf("toFP_Double_ToDouble(0x1.5p5 /* 42.0 */) = %a\n", sbv_result);
}
void toFP_Integer_ToDouble_driver(void)
{
const SDouble sbv_result = toFP_Integer_ToDouble(0x000000000000002aLL);
printf("toFP_Integer_ToDouble(0x000000000000002aLL) = %a\n", sbv_result);
}
void toFP_Real_ToDouble_driver(void)
{
const SDouble sbv_result = toFP_Real_ToDouble(42.0L);
printf("toFP_Real_ToDouble(42.0L) = %a\n", sbv_result);
}
void fromFP_Float_ToInt8_driver(void)
{
const SInt8 sbv_result = fromFP_Float_ToInt8(0x1.5p5F /* 42.0F */);
printf("fromFP_Float_ToInt8(0x1.5p5F /* 42.0F */) = %"PRId8"\n", sbv_result);
}
void fromFP_Float_ToInt16_driver(void)
{
const SInt16 sbv_result = fromFP_Float_ToInt16(0x1.5p5F /* 42.0F */);
printf("fromFP_Float_ToInt16(0x1.5p5F /* 42.0F */) = %"PRId16"\n", sbv_result);
}
void fromFP_Float_ToInt32_driver(void)
{
const SInt32 sbv_result = fromFP_Float_ToInt32(0x1.5p5F /* 42.0F */);
printf("fromFP_Float_ToInt32(0x1.5p5F /* 42.0F */) = %"PRId32"L\n", sbv_result);
}
void fromFP_Float_ToInt64_driver(void)
{
const SInt64 sbv_result = fromFP_Float_ToInt64(0x1.5p5F /* 42.0F */);
printf("fromFP_Float_ToInt64(0x1.5p5F /* 42.0F */) = %"PRId64"LL\n", sbv_result);
}
void fromFP_Float_ToWord8_driver(void)
{
const SWord8 sbv_result = fromFP_Float_ToWord8(0x1.5p5F /* 42.0F */);
printf("fromFP_Float_ToWord8(0x1.5p5F /* 42.0F */) = %"PRIu8"\n", sbv_result);
}
void fromFP_Float_ToWord16_driver(void)
{
const SWord16 sbv_result = fromFP_Float_ToWord16(0x1.5p5F /* 42.0F */);
printf("fromFP_Float_ToWord16(0x1.5p5F /* 42.0F */) = 0x%04"PRIx16"U\n", sbv_result);
}
void fromFP_Float_ToWord32_driver(void)
{
const SWord32 sbv_result = fromFP_Float_ToWord32(0x1.5p5F /* 42.0F */);
printf("fromFP_Float_ToWord32(0x1.5p5F /* 42.0F */) = 0x%08"PRIx32"UL\n", sbv_result);
}
void fromFP_Float_ToWord64_driver(void)
{
const SWord64 sbv_result = fromFP_Float_ToWord64(0x1.5p5F /* 42.0F */);
printf("fromFP_Float_ToWord64(0x1.5p5F /* 42.0F */) = 0x%016"PRIx64"ULL\n", sbv_result);
}
void fromFP_Float_ToFloat_driver(void)
{
const SFloat sbv_result = fromFP_Float_ToFloat(0x1.5p5F /* 42.0F */);
printf("fromFP_Float_ToFloat(0x1.5p5F /* 42.0F */) = %a\n", sbv_result);
}
void fromFP_Float_ToDouble_driver(void)
{
const SDouble sbv_result = fromFP_Float_ToDouble(0x1.5p5F /* 42.0F */);
printf("fromFP_Float_ToDouble(0x1.5p5F /* 42.0F */) = %a\n", sbv_result);
}
void fromFP_Float_ToInteger_driver(void)
{
const SInteger sbv_result = fromFP_Float_ToInteger(0x1.5p5F /* 42.0F */);
printf("fromFP_Float_ToInteger(0x1.5p5F /* 42.0F */) = %"PRId64"LL\n", sbv_result);
}
void fromFP_Float_ToReal_driver(void)
{
const SReal sbv_result = fromFP_Float_ToReal(0x1.5p5F /* 42.0F */);
printf("fromFP_Float_ToReal(0x1.5p5F /* 42.0F */) = %Lf\n", sbv_result);
}
void fromFP_DoubleTo_Int8_driver(void)
{
const SInt8 sbv_result = fromFP_DoubleTo_Int8(0x1.5p5 /* 42.0 */);
printf("fromFP_DoubleTo_Int8(0x1.5p5 /* 42.0 */) = %"PRId8"\n", sbv_result);
}
void fromFP_DoubleTo_Int16_driver(void)
{
const SInt16 sbv_result = fromFP_DoubleTo_Int16(0x1.5p5 /* 42.0 */);
printf("fromFP_DoubleTo_Int16(0x1.5p5 /* 42.0 */) = %"PRId16"\n", sbv_result);
}
void fromFP_DoubleTo_Int32_driver(void)
{
const SInt32 sbv_result = fromFP_DoubleTo_Int32(0x1.5p5 /* 42.0 */);
printf("fromFP_DoubleTo_Int32(0x1.5p5 /* 42.0 */) = %"PRId32"L\n", sbv_result);
}
void fromFP_DoubleTo_Int64_driver(void)
{
const SInt64 sbv_result = fromFP_DoubleTo_Int64(0x1.5p5 /* 42.0 */);
printf("fromFP_DoubleTo_Int64(0x1.5p5 /* 42.0 */) = %"PRId64"LL\n", sbv_result);
}
void fromFP_DoubleTo_Word8_driver(void)
{
const SWord8 sbv_result = fromFP_DoubleTo_Word8(0x1.5p5 /* 42.0 */);
printf("fromFP_DoubleTo_Word8(0x1.5p5 /* 42.0 */) = %"PRIu8"\n", sbv_result);
}
void fromFP_DoubleTo_Word16_driver(void)
{
const SWord16 sbv_result = fromFP_DoubleTo_Word16(0x1.5p5 /* 42.0 */);
printf("fromFP_DoubleTo_Word16(0x1.5p5 /* 42.0 */) = 0x%04"PRIx16"U\n", sbv_result);
}
void fromFP_DoubleTo_Word32_driver(void)
{
const SWord32 sbv_result = fromFP_DoubleTo_Word32(0x1.5p5 /* 42.0 */);
printf("fromFP_DoubleTo_Word32(0x1.5p5 /* 42.0 */) = 0x%08"PRIx32"UL\n", sbv_result);
}
void fromFP_DoubleTo_Word64_driver(void)
{
const SWord64 sbv_result = fromFP_DoubleTo_Word64(0x1.5p5 /* 42.0 */);
printf("fromFP_DoubleTo_Word64(0x1.5p5 /* 42.0 */) = 0x%016"PRIx64"ULL\n", sbv_result);
}
void fromFP_DoubleTo_Float_driver(void)
{
const SFloat sbv_result = fromFP_DoubleTo_Float(0x1.5p5 /* 42.0 */);
printf("fromFP_DoubleTo_Float(0x1.5p5 /* 42.0 */) = %a\n", sbv_result);
}
void fromFP_DoubleTo_Double_driver(void)
{
const SDouble sbv_result = fromFP_DoubleTo_Double(0x1.5p5 /* 42.0 */);
printf("fromFP_DoubleTo_Double(0x1.5p5 /* 42.0 */) = %a\n", sbv_result);
}
void fromFP_DoubleTo_Integer_driver(void)
{
const SInteger sbv_result = fromFP_DoubleTo_Integer(0x1.5p5 /* 42.0 */);
printf("fromFP_DoubleTo_Integer(0x1.5p5 /* 42.0 */) = %"PRId64"LL\n", sbv_result);
}
void fromFP_DoubleTo_Real_driver(void)
{
const SReal sbv_result = fromFP_DoubleTo_Real(0x1.5p5 /* 42.0 */);
printf("fromFP_DoubleTo_Real(0x1.5p5 /* 42.0 */) = %Lf\n", sbv_result);
}
void fromFP_SWord32_SFloat_driver(void)
{
const SFloat sbv_result = fromFP_SWord32_SFloat(0x0000002aUL);
printf("fromFP_SWord32_SFloat(0x0000002aUL) = %a\n", sbv_result);
}
void fromFP_SWord64_SDouble_driver(void)
{
const SDouble sbv_result = fromFP_SWord64_SDouble(0x000000000000002aULL);
printf("fromFP_SWord64_SDouble(0x000000000000002aULL) = %a\n", sbv_result);
}
void fromFP_SFloat_SWord32_driver(void)
{
const SWord32 sbv_result = fromFP_SFloat_SWord32(0x1.5p5F /* 42.0F */);
printf("fromFP_SFloat_SWord32(0x1.5p5F /* 42.0F */) = 0x%08"PRIx32"UL\n", sbv_result);
}
void fromFP_SDouble_SWord64_driver(void)
{
const SWord64 sbv_result = fromFP_SDouble_SWord64(0x1.5p5 /* 42.0 */);
printf("fromFP_SDouble_SWord64(0x1.5p5 /* 42.0 */) = 0x%016"PRIx64"ULL\n", sbv_result);
}
void f_FP_Abs_driver(void)
{
const SFloat sbv_result = f_FP_Abs(0x1.5p5F /* 42.0F */);
printf("f_FP_Abs(0x1.5p5F /* 42.0F */) = %a\n", sbv_result);
}
void d_FP_Abs_driver(void)
{
const SDouble sbv_result = d_FP_Abs(0x1.5p5 /* 42.0 */);
printf("d_FP_Abs(0x1.5p5 /* 42.0 */) = %a\n", sbv_result);
}
void f_FP_Neg_driver(void)
{
const SFloat sbv_result = f_FP_Neg(0x1.5p5F /* 42.0F */);
printf("f_FP_Neg(0x1.5p5F /* 42.0F */) = %a\n", sbv_result);
}
void d_FP_Neg_driver(void)
{
const SDouble sbv_result = d_FP_Neg(0x1.5p5 /* 42.0 */);
printf("d_FP_Neg(0x1.5p5 /* 42.0 */) = %a\n", sbv_result);
}
void f_FP_Add_driver(void)
{
const SFloat sbv_result = f_FP_Add(0x1.5p5F /* 42.0F */,
0x1.58p5F /* 43.0F */);
printf("f_FP_Add(0x1.5p5F /* 42.0F */, 0x1.58p5F /* 43.0F */) = %a\n", sbv_result);
}
void d_FP_Add_driver(void)
{
const SDouble sbv_result = d_FP_Add(0x1.5p5 /* 42.0 */,
0x1.58p5 /* 43.0 */);
printf("d_FP_Add(0x1.5p5 /* 42.0 */, 0x1.58p5 /* 43.0 */) = %a\n", sbv_result);
}
void f_FP_Sub_driver(void)
{
const SFloat sbv_result = f_FP_Sub(0x1.5p5F /* 42.0F */,
0x1.58p5F /* 43.0F */);
printf("f_FP_Sub(0x1.5p5F /* 42.0F */, 0x1.58p5F /* 43.0F */) = %a\n", sbv_result);
}
void d_FP_Sub_driver(void)
{
const SDouble sbv_result = d_FP_Sub(0x1.5p5 /* 42.0 */,
0x1.58p5 /* 43.0 */);
printf("d_FP_Sub(0x1.5p5 /* 42.0 */, 0x1.58p5 /* 43.0 */) = %a\n", sbv_result);
}
void f_FP_Mul_driver(void)
{
const SFloat sbv_result = f_FP_Mul(0x1.5p5F /* 42.0F */,
0x1.58p5F /* 43.0F */);
printf("f_FP_Mul(0x1.5p5F /* 42.0F */, 0x1.58p5F /* 43.0F */) = %a\n", sbv_result);
}
void d_FP_Mul_driver(void)
{
const SDouble sbv_result = d_FP_Mul(0x1.5p5 /* 42.0 */,
0x1.58p5 /* 43.0 */);
printf("d_FP_Mul(0x1.5p5 /* 42.0 */, 0x1.58p5 /* 43.0 */) = %a\n", sbv_result);
}
void f_FP_Div_driver(void)
{
const SFloat sbv_result = f_FP_Div(0x1.5p5F /* 42.0F */,
0x1.58p5F /* 43.0F */);
printf("f_FP_Div(0x1.5p5F /* 42.0F */, 0x1.58p5F /* 43.0F */) = %a\n", sbv_result);
}
void d_FP_Div_driver(void)
{
const SDouble sbv_result = d_FP_Div(0x1.5p5 /* 42.0 */,
0x1.58p5 /* 43.0 */);
printf("d_FP_Div(0x1.5p5 /* 42.0 */, 0x1.58p5 /* 43.0 */) = %a\n", sbv_result);
}
void f_FP_FMA_driver(void)
{
const SFloat sbv_result = f_FP_FMA(0x1.5p5F /* 42.0F */,
0x1.58p5F /* 43.0F */, 0x1.6p5F /* 44.0F */);
printf("f_FP_FMA(0x1.5p5F /* 42.0F */, 0x1.58p5F /* 43.0F */, 0x1.6p5F /* 44.0F */) = %a\n", sbv_result);
}
void d_FP_FMA_driver(void)
{
const SDouble sbv_result = d_FP_FMA(0x1.5p5 /* 42.0 */,
0x1.58p5 /* 43.0 */, 0x1.6p5 /* 44.0 */);
printf("d_FP_FMA(0x1.5p5 /* 42.0 */, 0x1.58p5 /* 43.0 */, 0x1.6p5 /* 44.0 */) = %a\n", sbv_result);
}
void f_FP_Sqrt_driver(void)
{
const SFloat sbv_result = f_FP_Sqrt(0x1.5p5F /* 42.0F */);
printf("f_FP_Sqrt(0x1.5p5F /* 42.0F */) = %a\n", sbv_result);
}
void d_FP_Sqrt_driver(void)
{
const SDouble sbv_result = d_FP_Sqrt(0x1.5p5 /* 42.0 */);
printf("d_FP_Sqrt(0x1.5p5 /* 42.0 */) = %a\n", sbv_result);
}
void f_FP_Rem_driver(void)
{
const SFloat sbv_result = f_FP_Rem(0x1.5p5F /* 42.0F */,
0x1.58p5F /* 43.0F */);
printf("f_FP_Rem(0x1.5p5F /* 42.0F */, 0x1.58p5F /* 43.0F */) = %a\n", sbv_result);
}
void d_FP_Rem_driver(void)
{
const SDouble sbv_result = d_FP_Rem(0x1.5p5 /* 42.0 */,
0x1.58p5 /* 43.0 */);
printf("d_FP_Rem(0x1.5p5 /* 42.0 */, 0x1.58p5 /* 43.0 */) = %a\n", sbv_result);
}
void f_FP_RoundToIntegral_driver(void)
{
const SFloat sbv_result = f_FP_RoundToIntegral(0x1.5p5F /* 42.0F */);
printf("f_FP_RoundToIntegral(0x1.5p5F /* 42.0F */) = %a\n", sbv_result);
}
void d_FP_RoundToIntegral_driver(void)
{
const SDouble sbv_result = d_FP_RoundToIntegral(0x1.5p5 /* 42.0 */);
printf("d_FP_RoundToIntegral(0x1.5p5 /* 42.0 */) = %a\n", sbv_result);
}
void f_FP_Min_driver(void)
{
const SFloat sbv_result = f_FP_Min(0x1.5p5F /* 42.0F */,
0x1.58p5F /* 43.0F */);
printf("f_FP_Min(0x1.5p5F /* 42.0F */, 0x1.58p5F /* 43.0F */) = %a\n", sbv_result);
}
void d_FP_Min_driver(void)
{
const SDouble sbv_result = d_FP_Min(0x1.5p5 /* 42.0 */,
0x1.58p5 /* 43.0 */);
printf("d_FP_Min(0x1.5p5 /* 42.0 */, 0x1.58p5 /* 43.0 */) = %a\n", sbv_result);
}
void f_FP_Max_driver(void)
{
const SFloat sbv_result = f_FP_Max(0x1.5p5F /* 42.0F */,
0x1.58p5F /* 43.0F */);
printf("f_FP_Max(0x1.5p5F /* 42.0F */, 0x1.58p5F /* 43.0F */) = %a\n", sbv_result);
}
void d_FP_Max_driver(void)
{
const SDouble sbv_result = d_FP_Max(0x1.5p5 /* 42.0 */,
0x1.58p5 /* 43.0 */);
printf("d_FP_Max(0x1.5p5 /* 42.0 */, 0x1.58p5 /* 43.0 */) = %a\n", sbv_result);
}
void f_FP_IsEqualObject_driver(void)
{
const SBool sbv_result = f_FP_IsEqualObject(0x1.5p5F /* 42.0F */,
0x1.58p5F /* 43.0F */);
printf("f_FP_IsEqualObject(0x1.5p5F /* 42.0F */, 0x1.58p5F /* 43.0F */) = %d\n", sbv_result);
}
void d_FP_IsEqualObject_driver(void)
{
const SBool sbv_result = d_FP_IsEqualObject(0x1.5p5 /* 42.0 */,
0x1.58p5 /* 43.0 */);
printf("d_FP_IsEqualObject(0x1.5p5 /* 42.0 */, 0x1.58p5 /* 43.0 */) = %d\n", sbv_result);
}
void f_FP_IsNormal_driver(void)
{
const SBool sbv_result = f_FP_IsNormal(0x1.5p5F /* 42.0F */);
printf("f_FP_IsNormal(0x1.5p5F /* 42.0F */) = %d\n", sbv_result);
}
void d_FP_IsNormal_driver(void)
{
const SBool sbv_result = d_FP_IsNormal(0x1.5p5 /* 42.0 */);
printf("d_FP_IsNormal(0x1.5p5 /* 42.0 */) = %d\n", sbv_result);
}
void f_FP_IsZero_driver(void)
{
const SBool sbv_result = f_FP_IsZero(0x1.5p5F /* 42.0F */);
printf("f_FP_IsZero(0x1.5p5F /* 42.0F */) = %d\n", sbv_result);
}
void d_FP_IsZero_driver(void)
{
const SBool sbv_result = d_FP_IsZero(0x1.5p5 /* 42.0 */);
printf("d_FP_IsZero(0x1.5p5 /* 42.0 */) = %d\n", sbv_result);
}
void f_FP_IsSubnormal_driver(void)
{
const SBool sbv_result = f_FP_IsSubnormal(0x1.5p5F /* 42.0F */);
printf("f_FP_IsSubnormal(0x1.5p5F /* 42.0F */) = %d\n", sbv_result);
}
void d_FP_IsSubnormal_driver(void)
{
const SBool sbv_result = d_FP_IsSubnormal(0x1.5p5 /* 42.0 */);
printf("d_FP_IsSubnormal(0x1.5p5 /* 42.0 */) = %d\n", sbv_result);
}
void f_FP_IsInfinite_driver(void)
{
const SBool sbv_result = f_FP_IsInfinite(0x1.5p5F /* 42.0F */);
printf("f_FP_IsInfinite(0x1.5p5F /* 42.0F */) = %d\n", sbv_result);
}
void d_FP_IsInfinite_driver(void)
{
const SBool sbv_result = d_FP_IsInfinite(0x1.5p5 /* 42.0 */);
printf("d_FP_IsInfinite(0x1.5p5 /* 42.0 */) = %d\n", sbv_result);
}
void f_FP_IsNaN_driver(void)
{
const SBool sbv_result = f_FP_IsNaN(0x1.5p5F /* 42.0F */);
printf("f_FP_IsNaN(0x1.5p5F /* 42.0F */) = %d\n", sbv_result);
}
void d_FP_IsNaN_driver(void)
{
const SBool sbv_result = d_FP_IsNaN(0x1.5p5 /* 42.0 */);
printf("d_FP_IsNaN(0x1.5p5 /* 42.0 */) = %d\n", sbv_result);
}
void f_FP_IsNegative_driver(void)
{
const SBool sbv_result = f_FP_IsNegative(0x1.5p5F /* 42.0F */);
printf("f_FP_IsNegative(0x1.5p5F /* 42.0F */) = %d\n", sbv_result);
}
void d_FP_IsNegative_driver(void)
{
const SBool sbv_result = d_FP_IsNegative(0x1.5p5 /* 42.0 */);
printf("d_FP_IsNegative(0x1.5p5 /* 42.0 */) = %d\n", sbv_result);
}
void f_FP_IsPositive_driver(void)
{
const SBool sbv_result = f_FP_IsPositive(0x1.5p5F /* 42.0F */);
printf("f_FP_IsPositive(0x1.5p5F /* 42.0F */) = %d\n", sbv_result);
}
void d_FP_IsPositive_driver(void)
{
const SBool sbv_result = d_FP_IsPositive(0x1.5p5 /* 42.0 */);
printf("d_FP_IsPositive(0x1.5p5 /* 42.0 */) = %d\n", sbv_result);
}
int main(void)
{
printf("====================================\n");
printf("** Driver run for toFP_Int8_ToFloat:\n");
printf("====================================\n");
toFP_Int8_ToFloat_driver();
printf("=====================================\n");
printf("** Driver run for toFP_Int16_ToFloat:\n");
printf("=====================================\n");
toFP_Int16_ToFloat_driver();
printf("=====================================\n");
printf("** Driver run for toFP_Int32_ToFloat:\n");
printf("=====================================\n");
toFP_Int32_ToFloat_driver();
printf("=====================================\n");
printf("** Driver run for toFP_Int64_ToFloat:\n");
printf("=====================================\n");
toFP_Int64_ToFloat_driver();
printf("=====================================\n");
printf("** Driver run for toFP_Word8_ToFloat:\n");
printf("=====================================\n");
toFP_Word8_ToFloat_driver();
printf("======================================\n");
printf("** Driver run for toFP_Word16_ToFloat:\n");
printf("======================================\n");
toFP_Word16_ToFloat_driver();
printf("======================================\n");
printf("** Driver run for toFP_Word32_ToFloat:\n");
printf("======================================\n");
toFP_Word32_ToFloat_driver();
printf("======================================\n");
printf("** Driver run for toFP_Word64_ToFloat:\n");
printf("======================================\n");
toFP_Word64_ToFloat_driver();
printf("=====================================\n");
printf("** Driver run for toFP_Float_ToFloat:\n");
printf("=====================================\n");
toFP_Float_ToFloat_driver();
printf("======================================\n");
printf("** Driver run for toFP_Double_ToFloat:\n");
printf("======================================\n");
toFP_Double_ToFloat_driver();
printf("=======================================\n");
printf("** Driver run for toFP_Integer_ToFloat:\n");
printf("=======================================\n");
toFP_Integer_ToFloat_driver();
printf("====================================\n");
printf("** Driver run for toFP_Real_ToFloat:\n");
printf("====================================\n");
toFP_Real_ToFloat_driver();
printf("=====================================\n");
printf("** Driver run for toFP_Int8_ToDouble:\n");
printf("=====================================\n");
toFP_Int8_ToDouble_driver();
printf("======================================\n");
printf("** Driver run for toFP_Int16_ToDouble:\n");
printf("======================================\n");
toFP_Int16_ToDouble_driver();
printf("======================================\n");
printf("** Driver run for toFP_Int32_ToDouble:\n");
printf("======================================\n");
toFP_Int32_ToDouble_driver();
printf("======================================\n");
printf("** Driver run for toFP_Int64_ToDouble:\n");
printf("======================================\n");
toFP_Int64_ToDouble_driver();
printf("======================================\n");
printf("** Driver run for toFP_Word8_ToDouble:\n");
printf("======================================\n");
toFP_Word8_ToDouble_driver();
printf("=======================================\n");
printf("** Driver run for toFP_Word16_ToDouble:\n");
printf("=======================================\n");
toFP_Word16_ToDouble_driver();
printf("=======================================\n");
printf("** Driver run for toFP_Word32_ToDouble:\n");
printf("=======================================\n");
toFP_Word32_ToDouble_driver();
printf("=======================================\n");
printf("** Driver run for toFP_Word64_ToDouble:\n");
printf("=======================================\n");
toFP_Word64_ToDouble_driver();
printf("======================================\n");
printf("** Driver run for toFP_Float_ToDouble:\n");
printf("======================================\n");
toFP_Float_ToDouble_driver();
printf("=======================================\n");
printf("** Driver run for toFP_Double_ToDouble:\n");
printf("=======================================\n");
toFP_Double_ToDouble_driver();
printf("========================================\n");
printf("** Driver run for toFP_Integer_ToDouble:\n");
printf("========================================\n");
toFP_Integer_ToDouble_driver();
printf("=====================================\n");
printf("** Driver run for toFP_Real_ToDouble:\n");
printf("=====================================\n");
toFP_Real_ToDouble_driver();
printf("======================================\n");
printf("** Driver run for fromFP_Float_ToInt8:\n");
printf("======================================\n");
fromFP_Float_ToInt8_driver();
printf("=======================================\n");
printf("** Driver run for fromFP_Float_ToInt16:\n");
printf("=======================================\n");
fromFP_Float_ToInt16_driver();
printf("=======================================\n");
printf("** Driver run for fromFP_Float_ToInt32:\n");
printf("=======================================\n");
fromFP_Float_ToInt32_driver();
printf("=======================================\n");
printf("** Driver run for fromFP_Float_ToInt64:\n");
printf("=======================================\n");
fromFP_Float_ToInt64_driver();
printf("=======================================\n");
printf("** Driver run for fromFP_Float_ToWord8:\n");
printf("=======================================\n");
fromFP_Float_ToWord8_driver();
printf("========================================\n");
printf("** Driver run for fromFP_Float_ToWord16:\n");
printf("========================================\n");
fromFP_Float_ToWord16_driver();
printf("========================================\n");
printf("** Driver run for fromFP_Float_ToWord32:\n");
printf("========================================\n");
fromFP_Float_ToWord32_driver();
printf("========================================\n");
printf("** Driver run for fromFP_Float_ToWord64:\n");
printf("========================================\n");
fromFP_Float_ToWord64_driver();
printf("=======================================\n");
printf("** Driver run for fromFP_Float_ToFloat:\n");
printf("=======================================\n");
fromFP_Float_ToFloat_driver();
printf("========================================\n");
printf("** Driver run for fromFP_Float_ToDouble:\n");
printf("========================================\n");
fromFP_Float_ToDouble_driver();
printf("=========================================\n");
printf("** Driver run for fromFP_Float_ToInteger:\n");
printf("=========================================\n");
fromFP_Float_ToInteger_driver();
printf("======================================\n");
printf("** Driver run for fromFP_Float_ToReal:\n");
printf("======================================\n");
fromFP_Float_ToReal_driver();
printf("=======================================\n");
printf("** Driver run for fromFP_DoubleTo_Int8:\n");
printf("=======================================\n");
fromFP_DoubleTo_Int8_driver();
printf("========================================\n");
printf("** Driver run for fromFP_DoubleTo_Int16:\n");
printf("========================================\n");
fromFP_DoubleTo_Int16_driver();
printf("========================================\n");
printf("** Driver run for fromFP_DoubleTo_Int32:\n");
printf("========================================\n");
fromFP_DoubleTo_Int32_driver();
printf("========================================\n");
printf("** Driver run for fromFP_DoubleTo_Int64:\n");
printf("========================================\n");
fromFP_DoubleTo_Int64_driver();
printf("========================================\n");
printf("** Driver run for fromFP_DoubleTo_Word8:\n");
printf("========================================\n");
fromFP_DoubleTo_Word8_driver();
printf("=========================================\n");
printf("** Driver run for fromFP_DoubleTo_Word16:\n");
printf("=========================================\n");
fromFP_DoubleTo_Word16_driver();
printf("=========================================\n");
printf("** Driver run for fromFP_DoubleTo_Word32:\n");
printf("=========================================\n");
fromFP_DoubleTo_Word32_driver();
printf("=========================================\n");
printf("** Driver run for fromFP_DoubleTo_Word64:\n");
printf("=========================================\n");
fromFP_DoubleTo_Word64_driver();
printf("========================================\n");
printf("** Driver run for fromFP_DoubleTo_Float:\n");
printf("========================================\n");
fromFP_DoubleTo_Float_driver();
printf("=========================================\n");
printf("** Driver run for fromFP_DoubleTo_Double:\n");
printf("=========================================\n");
fromFP_DoubleTo_Double_driver();
printf("==========================================\n");
printf("** Driver run for fromFP_DoubleTo_Integer:\n");
printf("==========================================\n");
fromFP_DoubleTo_Integer_driver();
printf("=======================================\n");
printf("** Driver run for fromFP_DoubleTo_Real:\n");
printf("=======================================\n");
fromFP_DoubleTo_Real_driver();
printf("========================================\n");
printf("** Driver run for fromFP_SWord32_SFloat:\n");
printf("========================================\n");
fromFP_SWord32_SFloat_driver();
printf("=========================================\n");
printf("** Driver run for fromFP_SWord64_SDouble:\n");
printf("=========================================\n");
fromFP_SWord64_SDouble_driver();
printf("========================================\n");
printf("** Driver run for fromFP_SFloat_SWord32:\n");
printf("========================================\n");
fromFP_SFloat_SWord32_driver();
printf("=========================================\n");
printf("** Driver run for fromFP_SDouble_SWord64:\n");
printf("=========================================\n");
fromFP_SDouble_SWord64_driver();
printf("===========================\n");
printf("** Driver run for f_FP_Abs:\n");
printf("===========================\n");
f_FP_Abs_driver();
printf("===========================\n");
printf("** Driver run for d_FP_Abs:\n");
printf("===========================\n");
d_FP_Abs_driver();
printf("===========================\n");
printf("** Driver run for f_FP_Neg:\n");
printf("===========================\n");
f_FP_Neg_driver();
printf("===========================\n");
printf("** Driver run for d_FP_Neg:\n");
printf("===========================\n");
d_FP_Neg_driver();
printf("===========================\n");
printf("** Driver run for f_FP_Add:\n");
printf("===========================\n");
f_FP_Add_driver();
printf("===========================\n");
printf("** Driver run for d_FP_Add:\n");
printf("===========================\n");
d_FP_Add_driver();
printf("===========================\n");
printf("** Driver run for f_FP_Sub:\n");
printf("===========================\n");
f_FP_Sub_driver();
printf("===========================\n");
printf("** Driver run for d_FP_Sub:\n");
printf("===========================\n");
d_FP_Sub_driver();
printf("===========================\n");
printf("** Driver run for f_FP_Mul:\n");
printf("===========================\n");
f_FP_Mul_driver();
printf("===========================\n");
printf("** Driver run for d_FP_Mul:\n");
printf("===========================\n");
d_FP_Mul_driver();
printf("===========================\n");
printf("** Driver run for f_FP_Div:\n");
printf("===========================\n");
f_FP_Div_driver();
printf("===========================\n");
printf("** Driver run for d_FP_Div:\n");
printf("===========================\n");
d_FP_Div_driver();
printf("===========================\n");
printf("** Driver run for f_FP_FMA:\n");
printf("===========================\n");
f_FP_FMA_driver();
printf("===========================\n");
printf("** Driver run for d_FP_FMA:\n");
printf("===========================\n");
d_FP_FMA_driver();
printf("============================\n");
printf("** Driver run for f_FP_Sqrt:\n");
printf("============================\n");
f_FP_Sqrt_driver();
printf("============================\n");
printf("** Driver run for d_FP_Sqrt:\n");
printf("============================\n");
d_FP_Sqrt_driver();
printf("===========================\n");
printf("** Driver run for f_FP_Rem:\n");
printf("===========================\n");
f_FP_Rem_driver();
printf("===========================\n");
printf("** Driver run for d_FP_Rem:\n");
printf("===========================\n");
d_FP_Rem_driver();
printf("=======================================\n");
printf("** Driver run for f_FP_RoundToIntegral:\n");
printf("=======================================\n");
f_FP_RoundToIntegral_driver();
printf("=======================================\n");
printf("** Driver run for d_FP_RoundToIntegral:\n");
printf("=======================================\n");
d_FP_RoundToIntegral_driver();
printf("===========================\n");
printf("** Driver run for f_FP_Min:\n");
printf("===========================\n");
f_FP_Min_driver();
printf("===========================\n");
printf("** Driver run for d_FP_Min:\n");
printf("===========================\n");
d_FP_Min_driver();
printf("===========================\n");
printf("** Driver run for f_FP_Max:\n");
printf("===========================\n");
f_FP_Max_driver();
printf("===========================\n");
printf("** Driver run for d_FP_Max:\n");
printf("===========================\n");
d_FP_Max_driver();
printf("=====================================\n");
printf("** Driver run for f_FP_IsEqualObject:\n");
printf("=====================================\n");
f_FP_IsEqualObject_driver();
printf("=====================================\n");
printf("** Driver run for d_FP_IsEqualObject:\n");
printf("=====================================\n");
d_FP_IsEqualObject_driver();
printf("================================\n");
printf("** Driver run for f_FP_IsNormal:\n");
printf("================================\n");
f_FP_IsNormal_driver();
printf("================================\n");
printf("** Driver run for d_FP_IsNormal:\n");
printf("================================\n");
d_FP_IsNormal_driver();
printf("==============================\n");
printf("** Driver run for f_FP_IsZero:\n");
printf("==============================\n");
f_FP_IsZero_driver();
printf("==============================\n");
printf("** Driver run for d_FP_IsZero:\n");
printf("==============================\n");
d_FP_IsZero_driver();
printf("===================================\n");
printf("** Driver run for f_FP_IsSubnormal:\n");
printf("===================================\n");
f_FP_IsSubnormal_driver();
printf("===================================\n");
printf("** Driver run for d_FP_IsSubnormal:\n");
printf("===================================\n");
d_FP_IsSubnormal_driver();
printf("==================================\n");
printf("** Driver run for f_FP_IsInfinite:\n");
printf("==================================\n");
f_FP_IsInfinite_driver();
printf("==================================\n");
printf("** Driver run for d_FP_IsInfinite:\n");
printf("==================================\n");
d_FP_IsInfinite_driver();
printf("=============================\n");
printf("** Driver run for f_FP_IsNaN:\n");
printf("=============================\n");
f_FP_IsNaN_driver();
printf("=============================\n");
printf("** Driver run for d_FP_IsNaN:\n");
printf("=============================\n");
d_FP_IsNaN_driver();
printf("==================================\n");
printf("** Driver run for f_FP_IsNegative:\n");
printf("==================================\n");
f_FP_IsNegative_driver();
printf("==================================\n");
printf("** Driver run for d_FP_IsNegative:\n");
printf("==================================\n");
d_FP_IsNegative_driver();
printf("==================================\n");
printf("** Driver run for f_FP_IsPositive:\n");
printf("==================================\n");
f_FP_IsPositive_driver();
printf("==================================\n");
printf("** Driver run for d_FP_IsPositive:\n");
printf("==================================\n");
d_FP_IsPositive_driver();
return 0;
}
== END: "floatCodeGen_driver.c" ==================
== BEGIN: "Makefile" ================
# Makefile for floatCodeGen. Automatically generated by SBV. Do not edit!
# include any user-defined .mk file in the current directory.
-include *.mk
CC?=gcc
CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer
SBV_LIBS?=-lm -lbf
AR?=ar
ARFLAGS?=cr
all: floatCodeGen.a floatCodeGen_driver
floatCodeGen.a: toFP_Int8_ToFloat.o toFP_Int16_ToFloat.o toFP_Int32_ToFloat.o toFP_Int64_ToFloat.o toFP_Word8_ToFloat.o toFP_Word16_ToFloat.o toFP_Word32_ToFloat.o toFP_Word64_ToFloat.o toFP_Float_ToFloat.o toFP_Double_ToFloat.o toFP_Integer_ToFloat.o toFP_Real_ToFloat.o toFP_Int8_ToDouble.o toFP_Int16_ToDouble.o toFP_Int32_ToDouble.o toFP_Int64_ToDouble.o toFP_Word8_ToDouble.o toFP_Word16_ToDouble.o toFP_Word32_ToDouble.o toFP_Word64_ToDouble.o toFP_Float_ToDouble.o toFP_Double_ToDouble.o toFP_Integer_ToDouble.o toFP_Real_ToDouble.o fromFP_Float_ToInt8.o fromFP_Float_ToInt16.o fromFP_Float_ToInt32.o fromFP_Float_ToInt64.o fromFP_Float_ToWord8.o fromFP_Float_ToWord16.o fromFP_Float_ToWord32.o fromFP_Float_ToWord64.o fromFP_Float_ToFloat.o fromFP_Float_ToDouble.o fromFP_Float_ToInteger.o fromFP_Float_ToReal.o fromFP_DoubleTo_Int8.o fromFP_DoubleTo_Int16.o fromFP_DoubleTo_Int32.o fromFP_DoubleTo_Int64.o fromFP_DoubleTo_Word8.o fromFP_DoubleTo_Word16.o fromFP_DoubleTo_Word32.o fromFP_DoubleTo_Word64.o fromFP_DoubleTo_Float.o fromFP_DoubleTo_Double.o fromFP_DoubleTo_Integer.o fromFP_DoubleTo_Real.o fromFP_SWord32_SFloat.o fromFP_SWord64_SDouble.o fromFP_SFloat_SWord32.o fromFP_SDouble_SWord64.o f_FP_Abs.o d_FP_Abs.o f_FP_Neg.o d_FP_Neg.o f_FP_Add.o d_FP_Add.o f_FP_Sub.o d_FP_Sub.o f_FP_Mul.o d_FP_Mul.o f_FP_Div.o d_FP_Div.o f_FP_FMA.o d_FP_FMA.o f_FP_Sqrt.o d_FP_Sqrt.o f_FP_Rem.o d_FP_Rem.o f_FP_RoundToIntegral.o d_FP_RoundToIntegral.o f_FP_Min.o d_FP_Min.o f_FP_Max.o d_FP_Max.o f_FP_IsEqualObject.o d_FP_IsEqualObject.o f_FP_IsNormal.o d_FP_IsNormal.o f_FP_IsZero.o d_FP_IsZero.o f_FP_IsSubnormal.o d_FP_IsSubnormal.o f_FP_IsInfinite.o d_FP_IsInfinite.o f_FP_IsNaN.o d_FP_IsNaN.o f_FP_IsNegative.o d_FP_IsNegative.o f_FP_IsPositive.o d_FP_IsPositive.o
rm -f $@.tmp
${AR} ${ARFLAGS} $@.tmp $^
mv -f $@.tmp $@
floatCodeGen_driver: floatCodeGen_driver.c floatCodeGen.h floatCodeGen.a
${CC} ${CCFLAGS} -ffp-contract=off $< -o $@ floatCodeGen.a ${LDFLAGS} ${SBV_LIBS}
toFP_Int8_ToFloat.o: toFP_Int8_ToFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Int16_ToFloat.o: toFP_Int16_ToFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Int32_ToFloat.o: toFP_Int32_ToFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Int64_ToFloat.o: toFP_Int64_ToFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Word8_ToFloat.o: toFP_Word8_ToFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Word16_ToFloat.o: toFP_Word16_ToFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Word32_ToFloat.o: toFP_Word32_ToFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Word64_ToFloat.o: toFP_Word64_ToFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Float_ToFloat.o: toFP_Float_ToFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Double_ToFloat.o: toFP_Double_ToFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Integer_ToFloat.o: toFP_Integer_ToFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Real_ToFloat.o: toFP_Real_ToFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Int8_ToDouble.o: toFP_Int8_ToDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Int16_ToDouble.o: toFP_Int16_ToDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Int32_ToDouble.o: toFP_Int32_ToDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Int64_ToDouble.o: toFP_Int64_ToDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Word8_ToDouble.o: toFP_Word8_ToDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Word16_ToDouble.o: toFP_Word16_ToDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Word32_ToDouble.o: toFP_Word32_ToDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Word64_ToDouble.o: toFP_Word64_ToDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Float_ToDouble.o: toFP_Float_ToDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Double_ToDouble.o: toFP_Double_ToDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Integer_ToDouble.o: toFP_Integer_ToDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
toFP_Real_ToDouble.o: toFP_Real_ToDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_Float_ToInt8.o: fromFP_Float_ToInt8.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_Float_ToInt16.o: fromFP_Float_ToInt16.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_Float_ToInt32.o: fromFP_Float_ToInt32.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_Float_ToInt64.o: fromFP_Float_ToInt64.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_Float_ToWord8.o: fromFP_Float_ToWord8.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_Float_ToWord16.o: fromFP_Float_ToWord16.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_Float_ToWord32.o: fromFP_Float_ToWord32.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_Float_ToWord64.o: fromFP_Float_ToWord64.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_Float_ToFloat.o: fromFP_Float_ToFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_Float_ToDouble.o: fromFP_Float_ToDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_Float_ToInteger.o: fromFP_Float_ToInteger.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_Float_ToReal.o: fromFP_Float_ToReal.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_DoubleTo_Int8.o: fromFP_DoubleTo_Int8.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_DoubleTo_Int16.o: fromFP_DoubleTo_Int16.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_DoubleTo_Int32.o: fromFP_DoubleTo_Int32.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_DoubleTo_Int64.o: fromFP_DoubleTo_Int64.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_DoubleTo_Word8.o: fromFP_DoubleTo_Word8.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_DoubleTo_Word16.o: fromFP_DoubleTo_Word16.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_DoubleTo_Word32.o: fromFP_DoubleTo_Word32.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_DoubleTo_Word64.o: fromFP_DoubleTo_Word64.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_DoubleTo_Float.o: fromFP_DoubleTo_Float.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_DoubleTo_Double.o: fromFP_DoubleTo_Double.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_DoubleTo_Integer.o: fromFP_DoubleTo_Integer.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_DoubleTo_Real.o: fromFP_DoubleTo_Real.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_SWord32_SFloat.o: fromFP_SWord32_SFloat.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_SWord64_SDouble.o: fromFP_SWord64_SDouble.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_SFloat_SWord32.o: fromFP_SFloat_SWord32.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
fromFP_SDouble_SWord64.o: fromFP_SDouble_SWord64.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_Abs.o: f_FP_Abs.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_Abs.o: d_FP_Abs.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_Neg.o: f_FP_Neg.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_Neg.o: d_FP_Neg.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_Add.o: f_FP_Add.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_Add.o: d_FP_Add.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_Sub.o: f_FP_Sub.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_Sub.o: d_FP_Sub.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_Mul.o: f_FP_Mul.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_Mul.o: d_FP_Mul.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_Div.o: f_FP_Div.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_Div.o: d_FP_Div.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_FMA.o: f_FP_FMA.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_FMA.o: d_FP_FMA.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_Sqrt.o: f_FP_Sqrt.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_Sqrt.o: d_FP_Sqrt.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_Rem.o: f_FP_Rem.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_Rem.o: d_FP_Rem.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_RoundToIntegral.o: f_FP_RoundToIntegral.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_RoundToIntegral.o: d_FP_RoundToIntegral.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_Min.o: f_FP_Min.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_Min.o: d_FP_Min.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_Max.o: f_FP_Max.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_Max.o: d_FP_Max.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_IsEqualObject.o: f_FP_IsEqualObject.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_IsEqualObject.o: d_FP_IsEqualObject.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_IsNormal.o: f_FP_IsNormal.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_IsNormal.o: d_FP_IsNormal.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_IsZero.o: f_FP_IsZero.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_IsZero.o: d_FP_IsZero.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_IsSubnormal.o: f_FP_IsSubnormal.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_IsSubnormal.o: d_FP_IsSubnormal.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_IsInfinite.o: f_FP_IsInfinite.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_IsInfinite.o: d_FP_IsInfinite.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_IsNaN.o: f_FP_IsNaN.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_IsNaN.o: d_FP_IsNaN.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_IsNegative.o: f_FP_IsNegative.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_IsNegative.o: d_FP_IsNegative.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
f_FP_IsPositive.o: f_FP_IsPositive.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
d_FP_IsPositive.o: d_FP_IsPositive.c floatCodeGen.h
${CC} ${CCFLAGS} -ffp-contract=off -c $< -o $@
clean:
rm -f *.o
veryclean: clean
rm -f floatCodeGen.a floatCodeGen_driver floatCodeGen.a.tmp
== END: "Makefile" ==================