Skip to content

Commit 70ff4e6

Browse files
committed
Revert "ggml-cpu: switch fp16->fp32 to inline asm and test"
This reverts commit a88843a. Signed-off-by: Aaron Teo <[email protected]>
1 parent a88843a commit 70ff4e6

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

ggml/src/ggml-impl.h

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -428,17 +428,9 @@ GGML_API void ggml_aligned_free(void * ptr, size_t size);
428428

429429
// TODO: Determine if inline assembly is faster
430430
static inline float ggml_compute_fp16_to_fp32(ggml_fp16_t h) {
431-
float f;
432-
__asm__ (
433-
"vlvgp %%v0, %1, %1\n"
434-
"vreph %%v0, %%v0, 3\n"
435-
"vcnf %%v0, %%v0, 0, 1\n"
436-
"vclfnh %%v0, %%v0, 2, 0\n"
437-
"ler %0, %%f0\n" :
438-
/* out */ "=f"(f) :
439-
/* in */ "r"(h) :
440-
/* clobber */ "v0", "f0");
441-
return f;
431+
uint16x8_t v_h = vec_splats(h);
432+
uint16x8_t nnpa_dlf16 = vec_convert_from_fp16(v_h, 0);
433+
return vec_extend_to_fp32_hi(nnpa_dlf16, 0)[0];
442434
}
443435

444436
// TODO: Determine if inline assembly is faster

0 commit comments

Comments
 (0)