public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* SIMD Instruction supported ?
@ 2017-03-07 12:06 Amit kumar
  2017-03-07 12:54 ` Andrew Fish
  0 siblings, 1 reply; 2+ messages in thread
From: Amit kumar @ 2017-03-07 12:06 UTC (permalink / raw)
  To: edk2-devel@lists.01.org

Hi,
I have been trying to exploit SIMD capabilities in a EFI shell application.
I have written a code which calls a procedure with is written in X64 asm.
but my application freezes at the following instruction  
movdqa   xmm0, XMMWORD PTR [rax]

Is SIMD supported in UEFI ?

Platform Details :
Processor :: intel I7, IvyBridge;
P.S i have checked the CPUID and SSE2 XMM are supported. Also the similar code works in windows environment.

Regards 
Amit 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: SIMD Instruction supported ?
  2017-03-07 12:06 SIMD Instruction supported ? Amit kumar
@ 2017-03-07 12:54 ` Andrew Fish
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Fish @ 2017-03-07 12:54 UTC (permalink / raw)
  To: Amit kumar; +Cc: edk2-devel@lists.01.org


> On Mar 7, 2017, at 4:06 AM, Amit kumar <akamit91@hotmail.com> wrote:
> 
> Hi,
> I have been trying to exploit SIMD capabilities in a EFI shell application.
> I have written a code which calls a procedure with is written in X64 asm.
> but my application freezes at the following instruction  
> movdqa   xmm0, XMMWORD PTR [rax]
> 
> Is SIMD supported in UEFI ?
> 

Kind of. I don't think the ABI requires it so you can't generically assume it exists, but it should be safe to use if it exists. 

If you `git grep movdqa` you will find code that is using that instruction. 

Did you look at the value of RAX? It is likely not 16 byte aligned and you are taking a GP.  


> Platform Details :
> Processor :: intel I7, IvyBridge;
> P.S i have checked the CPUID and SSE2 XMM are supported. Also the similar code works in windows environment.
> 

I think you will find that malloc() is 16 byte aligned on Windows so that may be your issue. I.e. your code is non portable as it is making an implementation assumption, I think the contract from malloc is it is at least 8 byte aligned. I seem to remember AllocatePool() is 8 byte aligned.  You could convert movdqa to movups and see if your fault goes away, or you could make sure your buffers are aligned. 

Thanks,

Andrew Fish

> Regards 
> Amit 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-07 12:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-07 12:06 SIMD Instruction supported ? Amit kumar
2017-03-07 12:54 ` Andrew Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox