265265#undef  GGML_COMPUTE_FP32_TO_FP16
266266#endif 
267267
268- #define  GGML_COMPUTE_FP16_TO_FP32 (x ) ggml_compute_fp16_to_fp32 (x)
269- #define  GGML_COMPUTE_FP32_TO_FP16 (x ) ggml_compute_fp32_to_fp16 (x)
268+ #define  GGML_COMPUTE_FP16_TO_FP32 (x ) neon_compute_fp16_to_fp32 (x)
269+ #define  GGML_COMPUTE_FP32_TO_FP16 (x ) neon_compute_fp32_to_fp16 (x)
270270
271- #define  GGML_FP16_TO_FP32 (x ) ggml_compute_fp16_to_fp32 (x)
271+ #define  GGML_FP16_TO_FP32 (x ) neon_compute_fp16_to_fp32 (x)
272272
273- static  inline  float  ggml_compute_fp16_to_fp32 (ggml_fp16_t  h ) {
273+ static  inline  float  neon_compute_fp16_to_fp32 (ggml_fp16_t  h ) {
274274    __fp16  tmp ;
275275    memcpy (& tmp , & h , sizeof (ggml_fp16_t ));
276276    return  (float )tmp ;
277277}
278278
279- static  inline  ggml_fp16_t  ggml_compute_fp32_to_fp16 (float  f ) {
279+ static  inline  ggml_fp16_t  neon_compute_fp32_to_fp16 (float  f ) {
280280    ggml_fp16_t  res ;
281281    __fp16  tmp  =  f ;
282282    memcpy (& res , & tmp , sizeof (ggml_fp16_t ));
@@ -589,13 +589,13 @@ static inline unsigned char ggml_endian_byte(int i) {
589589#undef  GGML_COMPUTE_FP32_TO_FP16
590590#endif 
591591
592- #define  GGML_COMPUTE_FP16_TO_FP32 (x ) ggml_compute_fp16_to_fp32 (x)
593- #define  GGML_COMPUTE_FP32_TO_FP16 (x ) ggml_compute_fp32_to_fp16 (x)
592+ #define  GGML_COMPUTE_FP16_TO_FP32 (x ) power_compute_fp16_to_fp32 (x)
593+ #define  GGML_COMPUTE_FP32_TO_FP16 (x ) power_compute_fp32_to_fp16 (x)
594594/* the inline asm below is about 12% faster than the lookup method */ 
595595#define  GGML_FP16_TO_FP32 (x ) GGML_COMPUTE_FP16_TO_FP32(x)
596596#define  GGML_FP32_TO_FP16 (x ) GGML_COMPUTE_FP32_TO_FP16(x)
597597
598- static  inline  float  ggml_compute_fp16_to_fp32 (ggml_fp16_t  h ) {
598+ static  inline  float  power_compute_fp16_to_fp32 (ggml_fp16_t  h ) {
599599    float  f ;
600600    double  d ;
601601    __asm__(
@@ -608,7 +608,7 @@ static inline float ggml_compute_fp16_to_fp32(ggml_fp16_t h) {
608608    return  f ;
609609}
610610
611- static  inline  ggml_fp16_t  ggml_compute_fp32_to_fp16 (float  f ) {
611+ static  inline  ggml_fp16_t  power_compute_fp32_to_fp16 (float  f ) {
612612    double  d ;
613613    ggml_fp16_t  r ;
614614    __asm__( /* xscvdphp can work on double or single precision */ 
@@ -1155,7 +1155,7 @@ static inline ggml_fp16_t nnpa_compute_fp32_to_fp16(float f) {
11551155
11561156#elif  defined(__riscv ) &&  defined(__riscv_zfhmin )
11571157
1158- static  inline  float  ggml_compute_fp16_to_fp32 (ggml_fp16_t  h ) {
1158+ static  inline  float  riscv_compute_fp16_to_fp32 (ggml_fp16_t  h ) {
11591159    float  f ;
11601160    __asm__(
11611161        "fmv.h.x %[f], %[h]\n\t" 
@@ -1166,7 +1166,7 @@ static inline float ggml_compute_fp16_to_fp32(ggml_fp16_t h) {
11661166    return  f ;
11671167}
11681168
1169- static  inline  ggml_fp16_t  ggml_compute_fp32_to_fp16 (float  f ) {
1169+ static  inline  ggml_fp16_t  riscv_compute_fp32_to_fp16 (float  f ) {
11701170    ggml_fp16_t  res ;
11711171    __asm__(
11721172        "fcvt.h.s %[f], %[f]\n\t" 
@@ -1177,8 +1177,8 @@ static inline ggml_fp16_t ggml_compute_fp32_to_fp16(float f) {
11771177    return  res ;
11781178}
11791179
1180- #define  GGML_COMPUTE_FP16_TO_FP32 (x ) ggml_compute_fp16_to_fp32 (x)
1181- #define  GGML_COMPUTE_FP32_TO_FP16 (x ) ggml_compute_fp32_to_fp16 (x)
1180+ #define  GGML_COMPUTE_FP16_TO_FP32 (x ) riscv_compute_fp16_to_fp32 (x)
1181+ #define  GGML_COMPUTE_FP32_TO_FP16 (x ) riscv_compute_fp32_to_fp16 (x)
11821182#define  GGML_FP16_TO_FP32 (x ) GGML_COMPUTE_FP16_TO_FP32(x)
11831183#define  GGML_FP32_TO_FP16 (x ) GGML_COMPUTE_FP32_TO_FP16(x)
11841184
0 commit comments