flat assembler
Message board for the users of flat assembler.

Index > Windows > sse problem pcmpistri

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1701
Roman 13 Aug 2023, 10:44
fasmw 1.73 amd Ryzen 3500
Code:
;32 bits program
txtFind db 'We not played We'
txtA    db 'We              '

Start:                 ;pcmpistri to ecx index mask
use32
vimm = 0
movups xmm0,dqword [txtA]
movups xmm1,dqword [txtFind]
pcmpistri xmm0,xmm1,vimm
    


I try any values for vimm but always get ecx=0
How i understood in ecx return bits (like as mask)


Last edited by Roman on 13 Aug 2023, 12:04; edited 1 time in total
Post 13 Aug 2023, 10:44
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1701
Roman 13 Aug 2023, 12:02
This variant show 3 equal symbols in ecx
Code:
;32 bits program
txtFind db 'We not played We'
txtA    db 'We              '

Start:                 
vimm = 0x18
movups xmm0,dqword [txtA]
movups xmm1,dqword [txtFind]
pcmpistri xmm0,xmm1,vimm    ;return to ecx index mask
    
Post 13 Aug 2023, 12:02
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3913
Location: vpcmipstrm
bitRAKE 13 Aug 2023, 16:23
Roman wrote:
I try any values for vimm but always get ecx=0
How i understood in ecx return bits (like as mask)
But did you try:
Code:
vimm = 1_00_11_00b
;              00  unsigned bytes
;           11     ordered mode
;        00        polarity positive
;      1           last match    
... ECX returns an index because that's what the last "I" in the PCMPISTRI instruction means. The control bits ask for the last match - which starts at index 14. Ordered mode is used to find sub-string; instead of looking for single byte matches.

Feel free to say what your expectations are, and I will help you get there. If you're just exploring, try all 128 possible combinations of vimm and puzzle the stored result values.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 13 Aug 2023, 16:23
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1701
Roman 13 Aug 2023, 17:35
Post 13 Aug 2023, 17:35
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.