[gtk/fp16-tests: 1/2] ngl: Make the C half-float implementation accessible
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/fp16-tests: 1/2] ngl: Make the C half-float implementation accessible
- Date: Tue, 13 Jul 2021 13:20:07 +0000 (UTC)
commit fc9c34897a1d27eef50cf6ff52276e9be8073019
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jul 13 09:02:35 2021 -0400
ngl: Make the C half-float implementation accessible
Make this accessible for tests.
gsk/ngl/fp16.c | 4 ++--
gsk/ngl/fp16private.h | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gsk/ngl/fp16.c b/gsk/ngl/fp16.c
index 100d13e997..a1ff1d1af9 100644
--- a/gsk/ngl/fp16.c
+++ b/gsk/ngl/fp16.c
@@ -54,7 +54,7 @@ float_to_half (const float x)
return (b&0x80000000)>>16 | (e>112)*((((e-112)<<10)&0x7C00)|m>>13) |
((e<113)&(e>101))*((((0x007FF000+m)>>(125-e))+1)>>1) | (e>143)*0x7FFF; // sign : normalized : denormalized :
saturate
}
-static void
+void
float_to_half4_c (const float f[4],
guint16 h[4])
{
@@ -64,7 +64,7 @@ float_to_half4_c (const float f[4],
h[3] = float_to_half (f[3]);
}
-static void
+void
half_to_float4_c (const guint16 h[4],
float f[4])
{
diff --git a/gsk/ngl/fp16private.h b/gsk/ngl/fp16private.h
index a2c53d6c2d..574d7e4388 100644
--- a/gsk/ngl/fp16private.h
+++ b/gsk/ngl/fp16private.h
@@ -41,6 +41,12 @@ void float_to_half4_f16c (const float f[4],
void half_to_float4_f16c (const guint16 h[4],
float f[4]);
+void float_to_half4_c (const float f[4],
+ guint16 h[4]);
+
+void half_to_float4_c (const guint16 h[4],
+ float f[4]);
+
G_END_DECLS
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]