ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_fpu_probe.c File Reference

Double-precision FPU probe implementation (see ra8_fpu_probe.h). More...

#include "ra8_fpu_probe.h"
Include dependency graph for ra8_fpu_probe.c:

Go to the source code of this file.

Functions

double ra8_fpu_dp_madd (double a, double b, double c)
 Evaluate the double-precision product-sum a * b + c.

Detailed Description

Double-precision FPU probe implementation (see ra8_fpu_probe.h).

Holds the single double product-sum whose object-code lowering witnesses the FPU width of the build target: hardware .f64 opcodes on the RA8P1 DP-FPU build (-mfpu=fpv5-d16) versus soft-float __aeabi_d* calls on the RA8D2 SP-FPU build (-mfpu=fpv5-sp-d16). The authoritative contract lives on the declaration in ra8_fpu_probe.h.

Since
0.1.0

Definition in file ra8_fpu_probe.c.

Function Documentation

◆ ra8_fpu_dp_madd()

double ra8_fpu_dp_madd ( double a,
double b,
double c )

Evaluate the double-precision product-sum a * b + c.

A minimal IEEE-754 binary64 (double) computation used as a compile-target witness for the FPU width (see the file header). On a DP-FPU build the body lowers to hardware .f64 opcodes; on an SP-FPU build it lowers to soft-float calls. The math itself – multiply then add, or a fused multiply-add – is identical in both cases and is exercised for numeric correctness by the host unit test.

Parameters
[in]aFirst multiplicand, any finite double.
[in]bSecond multiplicand, any finite double.
[in]cAddend, any finite double.
Returns
The product-sum evaluated in double precision.
Return values
a*b+cThe IEEE-754 binary64 result (subject to a single rounding, or fewer if the compiler contracts to a fused multiply-add).
Precondition
a, b, c are ordinary double values (no NaN/Inf constraint – they propagate per IEEE-754).
The build selected an FPU via -mfpu (hard-float ABI in this project).
Postcondition
No hardware or global state is modified.
For finite inputs whose exact product-sum is representable, the result equals a * b + c.
Note
Thread-safe: pure function, no shared or static state.
See also
cmake/toolchain-ra8p1.cmake
Since
0.1.0

Definition at line 19 of file ra8_fpu_probe.c.