flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > bug in PEXTRW instruction

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 414
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 17 Jan 2017, 11:22
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



Joined: 16 Jun 2003
Posts: 8392
Location: Kraków, Poland
Tomasz Grysztar 17 Jan 2017, 11:48
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: 414
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 17 Jan 2017, 12:08
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



Joined: 16 Jun 2003
Posts: 8392
Location: Kraków, Poland
Tomasz Grysztar 17 Jan 2017, 12:25
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


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

Website powered by rwasa.