News for hackers. Stuff that matters.
Re:Show HN: Charcoal – Faster utf8.Valid using multi-byte pr... by WASDx on Tuesday March 26, 2024 @05:55AM (#39825930)
What is the gist of the algorithm? I'm not proficient at reading Go. Is it perhaps doing https://en.wikipedia.org/wiki/SWAR which is indeed SIMD?
Re:Show HN: Charcoal – Faster utf8.Valid using multi-byte pr... by danbruc on Tuesday March 26, 2024 @06:21AM (#39826071)
A description of the algorithm is here [1] and it is indeed SWAR.

[1] https://github.com/sugawarayuuta/charcoal/blob/main/docs/ind...

Re:Show HN: Charcoal – Faster utf8.Valid using multi-byte pr... by syrak on Tuesday March 26, 2024 @06:29AM (#39826130)
Re:Show HN: Charcoal – Faster utf8.Valid using multi-byte pr... by kevincox on Tuesday March 26, 2024 @08:54AM (#39827238)
Yes. The algorithm is very much using SIMD in the abstract sense but it isn't using SIMD instructions.

It is basically using 64 bit integer operations to check 8 bytes at a time.