Change implementation of round_f* in CodeGen_C to use nearbyint() to match CodeGen_LLVM - #6406
Conversation
|
Wouldn't it be better to change LLVM to use |
|
We thought that the LLVM backend is much more heavily used, so it would make sense to not change that behavior? |
|
That said: round does sound better than nearbyint (you are correct, round does not use the rounding mode, and nearbyint does not). |
Agreed, so I guess this is really "should we migrate the behavior to match" -- IMHO stuff that relies on current rounding mode is a flaky test waiting to happen. Maybe we should consider adding |
I guess it might be better in the sense that what In any case, the goal is to get matching behavior between two, so I'll be happy to change LLVM case instead if that's preferable. |
|
I think we should submit this (harmonizing LLVM and C without messing with the likely more common case), and then file an issue for switching from nearbyint to round (regardless of target). |
+1 |
round_f32/round_f64 implementations at
Halide/src/runtime/posix_math.ll
Line 130 in 408a277