-1

That is, if characters are 16-bit words, is the value of RAX and RDX in units of 1 = 1 16-bit character or is it the number of bytes?

I posted this question earlier in another post, and Peter Cordes was kind enough to reply, saying that he like me had not seen an example of the use with words. I am posting this question on its own so it has improved visibility, rather than being buried in a mound of other small questions.

Many thanks

Cecil Ward
  • 597
  • 2
  • 13

1 Answers1

1

If you read Intel's manual's description, it's pretty much 100% clear:

The length of each input is interpreted as being the absolute-value of the value in the length register. The absolute-value computation saturates to 16 (for bytes) and 8 (for words), based on the value of imm8[bit3] when the value in the length register is greater than 16 (8) or less than -16 (-8).

This only makes any sense if the units are words for word mode, otherwise you could only use the low 8 bytes of the XMM input registers.

Also, other parts of the description use 16 (8), like some I quoted in my answer to your previous question.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • Thank you very much indeed Peter. Your help is once again very much appreciated. Pain drugs yesterday made things a bit fuzzy so your help in locating that answer was invaluable. – Cecil Ward Jul 23 '20 at 07:27
  • @CecilWard: Sorry to hear you're not feeling well. SSE4.2 string instructions are mind-bending enough with a clear head; if you're not feeling 100% it might be more productive to work on something else, especially if you run into more problems grokking something. :/ – Peter Cordes Jul 23 '20 at 07:36
  • I’m afraid it’s a permanent condition. But a small challenge helps keep my mind off the pain. If I’m too bad then I just rest a while and come back to problems later. Since I used to do asm for a living 35 years ago I’m enjoying this like a visit to an old friend. I have friends who would much prefer to write stuff in C or even D and would want to stay well away from asm so the idea is to write the best ‘intrinsic-like’ access routines for D so that the caller can implement any kind of string application with them but actually I don’t know exactly what the caller is even doing. – Cecil Ward Jul 23 '20 at 08:15
  • Yes I see it clearly now in that intel manual. Brilliant. It is indeed quite clear. – Cecil Ward Jul 23 '20 at 08:27