Stream: general

Topic: How to store f32 using the Rust API?


view this post on Zulip Farooq (Nov 23 2024 at 18:51):

Hello. I'm using cranelift to compile a set of arithmetic operations on F32 and then execute them for more efficient use of computation time. But I can't find out how should I store a F32 after I've done some arithmetics on them. Here's my code and it fails during verification:
https://codeberg.org/farooqkz/wakegp/src/branch/master/src/compiler.rs#L95

The message is:

Verification error VerifierErrors([VerifierError { location: inst5, context: Some("store.i64 v2, v6  ; v2 = 0x7ffd_7df4_bd80, v6 = 0x1.800000p1"), message: "arg 1 (v6) with type f32 failed to satisfy type set ValueTypeSet { lanes: cranelift_bitset::scalar::ScalarBitSet<u16> { 0: true, 1: false, 2: false, 3: false, 4: false, 5: false, 6: false, 7: false, 8: false, 9: false, 10: false, 11: false, 12: false, 13: false, 14: false, 15: false }, ints: cranelift_bitset::scalar::ScalarBitSet<u8> { 0: false, 1: false, 2: false, 3: false, 4: false, 5: true, 6: true, 7: false }, floats: cranelift_bitset::scalar::ScalarBitSet<u8> { 0: false, 1: false, 2: false, 3: false, 4: false, 5: false, 6: false, 7: false }, dynamic_lanes: cranelift_bitset::scalar::ScalarBitSet<u16> { 0: false, 1: false, 2: false, 3: false, 4: false, 5: false, 6: false, 7: false, 8: false, 9: false, 10: false, 11: false, 12: false, 13: false, 14: false, 15: false } }" }])

Thanks in advance!

wakegp - Detecting wake words using Linear Genetic Programming

view this post on Zulip Farooq (Nov 23 2024 at 18:59):

BTW, meanwhile if you have suggestions for improving my code, I will appreciate that. Been programming for a quite long time but it's my first time trying to generate IR and using a compiler back-end. I am generating programs on the fly and then I want to compile them before testing them on a few thousands of testcases to gain a hopefully massive speedup.


Last updated: Dec 23 2024 at 12:05 UTC