Add test infrastructure for f16 and f128

Update test traits to support `f16` and `f128`, as applicable. Add the
new routines (`fabs` and `copysign` for `f16` and `f128`) to the list of
all operations.
This commit is contained in:
Trevor Gross
2025-01-03 00:12:53 +00:00
parent 42c7ace5ba
commit 6b5e8b20f0
13 changed files with 205 additions and 43 deletions

View File

@@ -4,6 +4,13 @@ use std::fmt;
use std::sync::LazyLock;
const ALL_OPERATIONS_NESTED: &[(FloatTy, Signature, Option<Signature>, &[&str])] = &[
(
// `fn(f16) -> f16`
FloatTy::F16,
Signature { args: &[Ty::F16], returns: &[Ty::F16] },
None,
&["fabsf16"],
),
(
// `fn(f32) -> f32`
FloatTy::F32,
@@ -28,6 +35,20 @@ const ALL_OPERATIONS_NESTED: &[(FloatTy, Signature, Option<Signature>, &[&str])]
"tgamma", "trunc", "y0", "y1",
],
),
(
// `fn(f128) -> f128`
FloatTy::F128,
Signature { args: &[Ty::F128], returns: &[Ty::F128] },
None,
&["fabsf128"],
),
(
// `(f16, f16) -> f16`
FloatTy::F16,
Signature { args: &[Ty::F16, Ty::F16], returns: &[Ty::F16] },
None,
&["copysignf16"],
),
(
// `(f32, f32) -> f32`
FloatTy::F32,
@@ -64,6 +85,13 @@ const ALL_OPERATIONS_NESTED: &[(FloatTy, Signature, Option<Signature>, &[&str])]
"remainder",
],
),
(
// `(f128, f128) -> f128`
FloatTy::F128,
Signature { args: &[Ty::F128, Ty::F128], returns: &[Ty::F128] },
None,
&["copysignf128"],
),
(
// `(f32, f32, f32) -> f32`
FloatTy::F32,