Module rvsim::softfloat[][src]

Berkeley SoftFloat bindings.

These are partial bindings, and only part of the SoftFloat package is actually linked into the library. Some of the names have been altered to be more in line with Rust naming.

Structs

Sf32

A single-precision soft-float. Internally represented as u32.

Sf64

A double-precision soft-float. Internally represented as u64.

Constants

FLAG_INEXACT

Inexact result exception.

FLAG_INFINITE

Result is infinity (division by zero).

FLAG_INVALID

Invalid operation (result is NaN).

FLAG_OVERFLOW

Overflow exception.

FLAG_UNDERFLOW

Underflow exception.

ROUND_MAX

Round towards +∞.

ROUND_MIN

Round towards -∞.

ROUND_MIN_MAG

Round towards 0.

ROUND_NEAR_EVEN

Round to nearest, ties to even.

ROUND_NEAR_MAXMAG

Round to nearest, ties away from 0.

Functions

f32_add

Addition with single-precision values.

f32_div

Division with single-precision values.

f32_eq

Test equality with single-precision values.

f32_is_signaling_nan

Whether the single-precision value is a signalling NaN.

f32_le

Test less-than-or-equal with single-precision values.

f32_lt

Test less-than with single-precision values.

f32_mul

Multiplication with single-precision values.

f32_mulAdd

Fused multiplication and addition with single-precision values.

f32_rem

Modulus / remainder with single-precision values.

f32_sqrt

Square root of a single-precision value.

f32_sub

Subtraction with single-precision values.

f32_to_f64

Convert a single-precision value to a double-precision value.

f32_to_i32

Convert a single-precision value to an i32.

f32_to_u32

Convert a single-precision value to a u32.

f64_add

Addition with double-precision values.

f64_div

Division with double-precision values.

f64_eq

Test equality with double-precision values.

f64_is_signaling_nan

Whether the double-precision value is a signalling NaN.

f64_le

Test less-than-or-equal with double-precision values.

f64_lt

Test less-than with double-precision values.

f64_mul

Multiplication with double-precision values.

f64_mulAdd

Fused multiplication and addition with double-precision values.

f64_rem

Modulus / remainder with double-precision values.

f64_sqrt

Square root of a double-precision value.

f64_sub

Subtraction with double-precision values.

f64_to_f32

Convert a double-precision value to a single-precision value.

f64_to_i32

Convert a double-precision value to an i32.

f64_to_u32

Convert a double-precision value to a u32.

get_flags

Get the exception flags from thread-local storage.

get_rounding_mode

Get the current rounding mode from thread-local storage.

i32_to_f32

Convert an i32 to a single-precision value.

i32_to_f64

Convert an i32 to a double-precision value.

raise_flags

Add to the exception flags.

set_flags

Set the exception flags.

set_rounding_mode

Set the rounding mode.

u32_to_f32

Convert a u32 to a single-precision value.

u32_to_f64

Convert a u32 to a double-precision value.