Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fsgnjx.s instruction is misbehaving with operand-b as infinity #67

Open
AuringzaibSabir opened this issue Oct 11, 2022 · 0 comments
Open

Comments

@AuringzaibSabir
Copy link

Found a bug in a floating point unit. fsgnjx.s instruction is misbehaving.

Ideally fsgnjx.s copy a signed value from one register to another register, while modifying the sign bit based on the sign from another value.

Examples:

FSGNJ.S  f2,f5,f6 	        # f2 =  sign(f6)  * |f5|
FSGNJN.S f2,f5,f6		# f2 = -sign(f6)  * |f5|
FSGNJX.S f2,f5,f6		# f2 =   sign(f6) *  f5

In case, the f6(rs2) register is infinity and the f5(rs1) register is any number, the result from spike(ISS) is the XOR of a sign of f6 (i.e. positive) with the sign bit of f5(rs1) register for FSGNJX.S instruction but the result from FPU is a NaN which is incorrect.

References

Screenshots of logs from the spike and FPU design are attached below for a reference

image

@AuringzaibSabir AuringzaibSabir changed the title fsgnjx.s instruction is misbehaving with infinity as operand-b fsgnjx.s instruction is misbehaving with operand-b as infinity Oct 11, 2022
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

No branches or pull requests

1 participant