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

Cranelift: Wrong result for fcvt_from_sint.f32 on RISCV #5952

Closed
afonso360 opened this issue Mar 7, 2023 · 2 comments · Fixed by #5964
Closed

Cranelift: Wrong result for fcvt_from_sint.f32 on RISCV #5952

afonso360 opened this issue Mar 7, 2023 · 2 comments · Fixed by #5964
Labels
bug Incorrect behavior in the current implementation that needs fixing cranelift:area:riscv64 Issues related to the RISC-V 64 backend. cranelift Issues related to the Cranelift code generator

Comments

@afonso360
Copy link
Contributor

afonso360 commented Mar 7, 2023

👋 Hey,

I re-ran the fuzzer today with the issues that were fixed in the past weeks, and it reported some new cases.

.clif Test Case

test interpret
test run
target riscv64gc

function %a(i16 uext) -> f32 {
block0(v0: i16):
    v1 = fcvt_from_sint.f32 v0
    return v1
}

; run: %a(-12800) == -0x1.900000p13

Steps to Reproduce

  • clif-util test ./the-above.clif

Expected Results

The test to pass!

Actual Results

 ERROR cranelift_filetests::concurrent > FAIL: run
FAIL ./lmao.clif: run

Caused by:
    Failed test: run: %a(-12800) == -0x1.900000p13, actual: 0x1.9c0000p15
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main (e2dcb19)

Operating system: Linux

Architecture: RISCV64GC

Extra Info

CC: @yuyang-ok

@afonso360 afonso360 added bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator cranelift:area:riscv64 Issues related to the RISC-V 64 backend. labels Mar 7, 2023
@yuyang-ok
Copy link
Contributor

yuyang-ok commented Mar 8, 2023

@afonso360 Looking at the ISLE lowering rules.I think we should extend from value first.

@yuyang-ok
Copy link
Contributor

@afonso360 Maybe a review. #5964

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior in the current implementation that needs fixing cranelift:area:riscv64 Issues related to the RISC-V 64 backend. cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants