Open wyanzhao opened 1 year ago
Can you try using a uint16_t constant with a smaller value as a test? Most of the test cases are based on 16 bit numbers.
I tried uint16_t and uint32_t, both of them are fine. Only in uint64_t, some special values can trigger this bug. I can give some groups of test data, when the constant is 2199023255551, 8796093022207, 4398046511103. After codegen, the value will turn to 511, 2047, and 1023. Have no idea about this issue.
Yea, so the coreir generation uses the top 32 bits right now instead of the full 64 bits.
Hi, I am trying to write a simple CoreIR program. But I found in some cases, the tool will produce incorrect CoreIR code. Here's the given Halide C++ code:
This program supposed to clear the 39th and 40th bit of
Input
. However, when I typemake coreir
, in the generated coreIR.cpp, the code will be:Where the
constant
expr will become 63, instead of the original 274877906943. And this will produce incorrect results.