flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Compiler Internals > bug in PEXTRW instruction

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 212
Location: film "CandyMan" directed through Bernard Rose
bug in PEXTRW instruction

Code:
pextrw eax,xmm2,1 


is assembled as avx512 instruction instead of sse41 (66 0F 3A 15 /r ib PEXTRW m16/r32,xmm,ib)

_________________
smaller is better
Post 17 Jan 2017, 11:22
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6435
Location: Kraków, Poland
Please provide more context, what version of fasm does this concern, what is the entire source tested, what are the generated bytes, etc.
I have tested this single line with both the fasm 1.71.58 and the latest fasmg macros and they both assemble this instruction as "66 0F C5 C2 01", which is neither SSE4 nor AVX, but plain old SSE2.
Post 17 Jan 2017, 11:48
View user's profile Send private message Visit poster's website Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 212
Location: film "CandyMan" directed through Bernard Rose
fasm version 1.71.57

Code:
pextrw [rax],xmm1,1 ;"66 0F 3A 15 08 01" OK
pextrw eax,xmm2,1   ;why not "66 0F 3A 15 D0 01" but "66 0F C5 C2 01" ?


_________________
smaller is better
Post 17 Jan 2017, 12:08
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6435
Location: Kraków, Poland

CandyMan wrote:

Code:
pextrw eax,xmm2,1   ;why not "66 0F 3A 15 D0 01" but "66 0F C5 C2 01" ?


Because "66 0F C5 C2 01" requires only SSE2 to run and also is shorter.
Post 17 Jan 2017, 12:25
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.