From 41178fcb3ba3899a63b29a99a1126496f39cb392 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Mon, 11 Sep 2023 16:36:06 +0800 Subject: [PATCH] removed float2half and float_to_half --- inc/hgl/math/HalfFloat.h | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/inc/hgl/math/HalfFloat.h b/inc/hgl/math/HalfFloat.h index 8670a2a..4d77d6e 100644 --- a/inc/hgl/math/HalfFloat.h +++ b/inc/hgl/math/HalfFloat.h @@ -54,16 +54,6 @@ namespace hgl */ void Float32toFloat16(half_float *output,const float *input,const uint count); - /** - * 快速版float32转float16处理 - */ - inline const half_float float2half(const float &f) - { - const uint32 x = *((uint32 *)&f); - - return ((x>>16)&0x8000)|((((x&0x7f800000)-0x38000000)>>13)&0x7c00)|((x>>13)&0x03ff); - } - inline const float half2float(const half_float &hf) { union @@ -87,16 +77,6 @@ namespace hgl } } - inline void float_to_half(half_float *target,const float *source,uint32 count) - { - while (count--) - { - *target = float2half(*source); - ++target; - ++source; - } - } - inline void half2u16(uint16 *output,const half_float *input,const uint count) { union