4 ms·
tl;dr: The string comparison intrinsic in the JVM uses a vectorised string comparison instruction. (vpcmpestri (of the pcmpxstrx family) isn't an especially cr
by ghusbands 9y ago
tl;dr: The string comparison intrinsic in the JVM uses a vectorised string comparison instruction.
(vpcmpestri (of the pcmpxstrx family) isn't an especially crazy instruction to use for string comparison. That's what it's designed for.)
- amelius 9y agoThanks for the tl;dr. I think the "crazy" adjective refers to the instruction, and not to the use of it. As the article explains, the instruction is quite complicated and has a large number of parameters.
- B4TMAN 9y agoIs there any place to get a proper manual of all these uses?
- brianon99 9y agoAgree that using vector instruction is not crazy at all. I am quite interested when I see the article title, and then deeply disappointed after I read it. I was expecting something like the strlen shown in the book The Hackers Delight, which loads 4 bytes into a int, ad then some bit masking and subtraction and a nlz (number of leading zero) to index the first 0 byte. Please read it first and that is what really what meant by crazy.