Skip to content

Conversation

alanjian85
Copy link
Collaborator

The implementations of FCVT.S.W and FCVT.S.WU in the commit 04ce561 are incorrect. In fact, instead of updating the bit representation of the float number directly, a correct implementation should convert the signed/unsigned number to float number while keeping the value of integer numbers. As a result, I use implicit conversion between integer and float at line 1031 and 1034 and assigned the converted value to rv->F rather than rv->F_int, which represent the float number itself and its representation, respectively.

The implementations of FCVT.S.W and FCVT.S.WU in the commit 04ce561 are
incorrect. In fact, instead of updating the bit representation of the
float number directly, a correct implementation should convert the
signed/unsigned number to float number while keeping the value of
integer numbers. As a result, I use implicit conversion between integer
and float at line 1031 and 1034 and assigned the converted value to
rv->F rather than rv->F_int, which represent the float number itself and
its representation, respectively.
@jserv jserv requested review from 2011eric and qwe661234 April 29, 2023 01:21
@qwe661234
Copy link
Collaborator

qwe661234 commented Apr 29, 2023

After examination, this patch fixes the segmentation fault error that occurs during the make quake.

@jserv jserv merged commit 3799326 into sysprog21:master Apr 29, 2023
@jserv
Copy link
Contributor

jserv commented Apr 29, 2023

Thank @alanjian85 for contributing!

vestata pushed a commit to vestata/rv32emu that referenced this pull request Jan 24, 2025
Fix the implementations of FCVT.S.W and FCVT.S.WU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants