flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > pshufb opcode

Author
Thread Post new topic Reply to topic
IntermittentP



Joined: 24 Sep 2015
Posts: 6
IntermittentP
When using the pshufb opcode I cannot get it to work with mem as the source. Works ok when xmm* used. Any thoughts.
Post 24 Sep 2015, 14:15
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
IntermittentP
The mask label should be made typeless (e.g. by putting a colon after its name), or the memory access type should be enforced with the dqword directive in the instruction.

_________________
Faith is a superposition of knowledge and fallacy
Post 24 Sep 2015, 15:05
View user's profile Send private message Reply with quote
IntermittentP



Joined: 24 Sep 2015
Posts: 6
IntermittentP
Thanks I_inc
I've tried the your suggestions but to no avail, trying dqword on the source, dest (and even both). Another opcode, psignb, which like pshufb, can also operate on 64 bits also fails. movdqu which is only 128 bits works ok. I'm using 1.71.39.
Post 24 Sep 2015, 15:40
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
IntermittentP
Please provide your code. Preferably a minimal example with the problem.

_________________
Faith is a superposition of knowledge and fallacy
Post 24 Sep 2015, 15:48
View user's profile Send private message Reply with quote
IntermittentP



Joined: 24 Sep 2015
Posts: 6
IntermittentP
Using psignb produces ... 66 0F 38 08 05 08 20 40 00

66 0F 38 08 seems correct

05 must be the xxm register. I used xxm0 but have been unable to decode the 05

08 20 40 00 is the correct address for the mask.

This data is produced by listing.exe from the .fas file.
Post 24 Sep 2015, 16:21
View user's profile Send private message Reply with quote
IntermittentP



Joined: 24 Sep 2015
Posts: 6
IntermittentP
Apologies. Of course in this instance the 05 is the dest.
Post 24 Sep 2015, 16:27
View user's profile Send private message Reply with quote
IntermittentP



Joined: 24 Sep 2015
Posts: 6
IntermittentP
Will provide code soonest. Am summoned atm!
Post 24 Sep 2015, 16:29
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
IntermittentP
Quote:
Apologies. Of course in this instance the 05 is the dest.

05 is the ModR/M byte, which specifies both the source and the destination. 05 stands for an operation with a register AL/AX/EAX/MM0/XMM0 and memory addressed by a displacement that follows.

_________________
Faith is a superposition of knowledge and fallacy
Post 24 Sep 2015, 16:58
View user's profile Send private message Reply with quote
IntermittentP



Joined: 24 Sep 2015
Posts: 6
IntermittentP
Thanks for that info I_inc, I'll try to find the info in the docs.
I minimised the code to present it here by bulk deletion of lines. As I was only experimenting I didn't store the original (Flatasm resaved on run). When the code was minimised the line ran with no problems which is a "good thing" but of course it would have been better to have found the problem. I'll play around with it and come back if I find anything interesting!

Thanks again I_inc.
Post 25 Sep 2015, 10:16
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17249
Location: In your JS exploiting you and your system
revolution
IntermittentP: If you show the source code we can probably help very easily. Please reduce it to just the lines of interest.
Post 25 Sep 2015, 10:43
View user's profile Send private message Visit poster's website 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-2020, Tomasz Grysztar.

Powered by rwasa.