Conversation
|
godlblot cortex m0+ including a version 3 version 3 might be an improved version of this but I am not sure it covers all issues of this PR scn_u32_hex("9:3k",4) == 9 No it does not cortex m0+ cortex m4 |
|
one might want to look at #19027 |
|
As I stated in PR #19027 (comment), the unittest for the fmt module are lacking. Your changes break the API promised in |
|
@Teufelchen1 : You probably already got something in mind would you want to make that a PR? |
|
Hey hey, the new test just got merged. It will fail with the current implementation in this PR. |
0d4160e to
b0b8167
Compare
How? |
seem like it needs an intermediate for the case-conversion |
|
https://godbolt.org/z/dz3c6d1oh for your experiments it has the old experiments (frome the previos comment) on top |
|
ah and the test ist still incomplete |
|
https://godbolt.org/z/KTYWf4v66 execute on x86 godlbolt reveals this PR will return i am not sure how it does that now i know : to ? are right behind 0-9 so they are alternative symbols for counting to f and the| 32 doesn't take a hit on them 0123456789:;<=>? |
b0b8167 to
1b6ab53
Compare
|
Yea I guess it's mostly obfuscation at this point… |
1b6ab53 to
e434332
Compare
e434332 to
53f6b9a
Compare
|
It's now even worse (more stack and more assembly, and the code is barely readable) https://godbolt.org/z/zMWGKWefT Do you really want to try to optimize this function? (I might be biased because i wrote the current implementation #19027 the pr also has a link to godbolt where you can find versions of this functions that are smaller on stack and in code but are also less safe ( one of them is probably also what this pr once was) ) If you do please provide some kind of proof for: "this is better" I like godbolt |
|
I am with @kfessel here. Closing this PR seems to be the best way to handle this? Even if we find an implementation that produces perfect out put for a given compiler: There are so many variables. So far we only looked at arm but RIOT supports more ISAs. How do their compilations compare? What is about run-time performance? etc. etc. |
|
In consent with benpicco: Closed, not worth the extra time. |
Contribution description
We can save a branch by always converting to lowercase first.
Testing procedure
tests-fmtintests/unittestscovers this.Issues/PRs references