2 ms·
Let me spoil the title - it's the SSE4.2 instruction dedicated to comparing C strings. Also, I had actually heard of it.
by astrange 10y ago
Let me spoil the title - it's the SSE4.2 instruction dedicated to comparing C strings. Also, I had actually heard of it.
- masklinn 10y ago> it's the SSE4.2 instruction dedicated to comparing C strings. PCMPESTRI isn't for comparing C strings since it takes an explicit length. PCMPISTRI is the one for implicit (null-terminated) length.
- Someone 10y agoNot only C strings; this code uses the Pascal string variant: "This monster of an instruction takes in 4 registers of input: the 2 strings themselves as parameters, plus their lengths in %rax and %rdx (‘e’ meaning explicit length - pcmpistri & pcmpistrm instead look for terminating nulls"