contributed by <wx200010> ( Shao-Huan, Yu )
Abstract
In this assignment, I chose Problem C as my topic. Since Problem C utilizes a technique for counting leading zeros to find the MSB position of the mantissa in the float16 to float32 conversion, I discovered that this technique can also accelerate computations in the sqrt(x) problem. By using a binary search method to find the square root, employing the CLZ function allows for quickly obtaining the MSB of the input 𝑥. By right-shifting it by half, we can derive a smaller binary search range, thereby reducing the number of search iterations.
:::info
In each assembly code display, if there are parts related to reducing RISC-V overhead or accelerating computational efficiency, I will write them before the code display.
:::
Problem C to RISC-V