Skip to content
This repository has been archived by the owner on Feb 20, 2025. It is now read-only.

Recip round fp32->fp16b if dest in 16bit mode #23

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions common/inc/sfpu/ckernel_sfpu_recip.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ sfpi_inline vFloat _sfpu_reciprocal_(const vFloat in)
return setexp(result, new_exp);
}

template <bool APPROXIMATION_MODE, int ITERATIONS>
template <bool APPROXIMATION_MODE, int ITERATIONS, bool is_fp32_dest_acc_en = true>
inline void _calculate_reciprocal_(const int iterations)
{
#pragma GCC unroll 8
Expand All @@ -70,7 +70,11 @@ inline void _calculate_reciprocal_(const int iterations)
}
v_endif;

dst_reg[0] = out;
if constexpr (is_fp32_dest_acc_en) {
dst_reg[0] = out;
} else {
dst_reg[0] = reinterpret<vFloat>(float_to_fp16b(out, 0));
}

dst_reg++;
}
Expand Down
Loading