News for hackers. Stuff that matters.
Re:Parsing integers quickly with AVX-512 by ape4 on Sunday September 24, 2023 @08:58PM (#37638588)
Do library atoi() actually do SIMD?
Re:Parsing integers quickly with AVX-512 by vinkelhake on Sunday September 24, 2023 @09:38PM (#37638793)
That would depend on the implementation. But it doesn't really matter, no one should be using atoi.
Re:Parsing integers quickly with AVX-512 by stingraycharles on Monday September 25, 2023 @12:25AM (#37639665)
Yeah, iirc it was exploitable because it doesn’t do any bounds checking or something like that, right?
Re:Parsing integers quickly with AVX-512 by Lt_Riza_Hawkeye on Monday September 25, 2023 @02:00AM (#37640099)
It bounds checks just fine, as long as you pass it a null-terminated string. It just returns 0 on error, so there's no way to know if the string was for example, larger than would fit in an int, or even just totally invalid, or if the user actually entered 0.
Re:Parsing integers quickly with AVX-512 by anonymoushn on Monday September 25, 2023 @12:19AM (#37639638)
In general almost nothing uses SIMD for processing strings :(
Re:Parsing integers quickly with AVX-512 by jzwinck on Monday September 25, 2023 @12:45AM (#37639747)
Not literally atoi() because most people don't use that anymore, but the C++ std::from_chars() uses SIMD in GCC 12+, thanks to some of the same people behind the OP: https://lemire.me/blog/2022/07/27/comparing-strtod-with-from...