Repository navigation
fix: AVR 16-bit int breaks large left-shifts in some implementations of fixed_point types - #2176
sutaburosu wants to merge 1 commit into
Conversation
…me `fixed_point` types
|
It just occurred to me that it might be preferable to also apply this pattern to the other fixed_point implementations, i.e. those which currently work correctly on AVR without needing this change. For the sake of clarity, I'm considering converting all variants of It should be noted that there are places where an unsigned type is static_cast to a signed fl::i16/32. I propose changing those to be signed too. e.g. this Thoughts? |
|
Thanks for this, yeah address sanitizer caught it too and had some similar fixes. You said you didn't the run tests? So I'm going to take these fixes and feed them into the AI so it can generation additional unit tests so that I can ensure this corner case is under validation. FYI git clone https://github.com/fastled/fastled
cd fastled
bash test # all dependencies automatically installed |
|
Ah, so there is a test suite I can easily run locally. Thanks for the pointer. Any thoughts on applying the same pattern to the other implementations? I only changed the 3 that are buggy on AVR, but I'm happy to do the same for the others if only so they more closely resemble one another. |
|
Yeah, I think this issue affects the other types. See this test path Today i'm going do a pass where I test all the fixed point types through the common test class using the template. I think there's some operators missing that aren't being caught in the fixed point specific non template classes. |
|
OK. I'm super tired. I'll extend the fix to the other types after some sleep. |
|
It will be fixed when you wake up. I'm going to make a template test and just fix it for everything and make sure all optimizations are optimized. I'm wondering if some of the divides can be eliminated. I'll see. |
I'm hoping this fixes #2174. I think an extensive test suite would improve my confidence.