public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* How to use compiler intrinsic function, such as :mmintrin.h
@ 2018-02-02 11:08 Tiger Liu(BJ-RD)
  0 siblings, 0 replies; 6+ messages in thread
From: Tiger Liu(BJ-RD) @ 2018-02-02 11:08 UTC (permalink / raw)
  To: edk2-devel@lists.01.org

Hi, experts:
I have a question about using compiler's intrinsic function.
It seems EDKII's compiler option doesn't support using intrinsic function.

Such as:
mmintrin.h      MMX
xmmintrin.h    SSE
emmintrin.h   SSE2
pmmintrin.h   SSE3
tmmintrin.h    SSSE3
intrin.h             SSE4A
smmintrin.h   SSE4.1
nmmintrin.h   SSE4.2
mm3dnow.h  3DNOW

Thanks

Best wishes,


?????
?????????????????????????????????????????????????????
CONFIDENTIAL NOTE:
This email contains confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized review, use, copying or forwarding of this email or the content of this email is strictly prohibited.


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: How to use compiler intrinsic function, such as :mmintrin.h
@ 2018-02-05  9:05 Tiger Liu(BJ-RD)
  2018-02-06  4:39 ` Gao, Liming
  0 siblings, 1 reply; 6+ messages in thread
From: Tiger Liu(BJ-RD) @ 2018-02-05  9:05 UTC (permalink / raw)
  To: edk2-devel@lists.01.org

Hi, experts:
I have a question about how to direct compiler to search dedicated include directory.
Such as:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include

I tried to tell  compiler through “/I” parameter.
“/I C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include”

But failed.

Best wishes,
发件人: Tiger Liu(BJ-RD)
发送时间: 2018年2月2日 19:08
收件人: edk2-devel@lists.01.org
主题: [EDK2] How to use compiler intrinsic function, such as :mmintrin.h

Hi, experts:
I have a question about using compiler’s intrinsic function.
It seems EDKII’s compiler option doesn’t support using intrinsic function.

Such as:
mmintrin.h      MMX
xmmintrin.h    SSE
emmintrin.h   SSE2
pmmintrin.h   SSE3
tmmintrin.h    SSSE3
intrin.h             SSE4A
smmintrin.h   SSE4.1
nmmintrin.h   SSE4.2
mm3dnow.h  3DNOW

Thanks

Best wishes,


保密声明:
本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容做任何未经授权的查阅、使用、复制或转发。
CONFIDENTIAL NOTE:
This email contains confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized review, use, copying or forwarding of this email or the content of this email is strictly prohibited.

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: How to use compiler intrinsic function, such as :mmintrin.h
@ 2018-02-06  4:57 Tiger Liu(BJ-RD)
  2018-02-06  5:00 ` Andrew Fish
  0 siblings, 1 reply; 6+ messages in thread
From: Tiger Liu(BJ-RD) @ 2018-02-06  4:57 UTC (permalink / raw)
  To: Gao, Liming, edk2-devel@lists.01.org

Hi, Liming:
Thanks for your reply.
I tried to compile a UEFI shell application.
And this app would call functions provided in mmintrin.h

So, I met this trouble.

Thanks

Best wishes,
-----邮件原件-----
发件人: Gao, Liming [mailto:liming.gao@intel.com]
发送时间: 2018年2月6日 12:39
收件人: Tiger Liu(BJ-RD) <TigerLiu@zhaoxin.com>; edk2-devel@lists.01.org
主题: RE: [edk2] [EDK2] How to use compiler intrinsic function, such as :mmintrin.h

Tiger:
  Yes. EDK2 doesn't support the intrinsic function. Because edk2 compiled EFI image run in target machine instead of OS, they can't link VS system libraries.

  And, EDK2 doesn't support to specify the include path in BuildOptions. If you want to use EDK2 build system to compile EXE file that run in OS, such as SecMain, you can compile it with system header file and library. The system header file include path is set in ENV include. If you type set include, you will se its value.

Thanks
Liming
>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Tiger Liu(BJ-RD)
>Sent: Monday, February 05, 2018 5:06 PM
>To: edk2-devel@lists.01.org
>Subject: Re: [edk2] [EDK2] How to use compiler intrinsic function, such
>as :mmintrin.h
>
>Hi, experts:
>I have a question about how to direct compiler to search dedicated
>include directory.
>Such as:
>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include
>
>I tried to tell  compiler through “/I” parameter.
>“/I C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include”
>
>But failed.
>
>Best wishes,
>发件人: Tiger Liu(BJ-RD)
>发送时间: 2018年2月2日 19:08
>收件人: edk2-devel@lists.01.org
>主题: [EDK2] How to use compiler intrinsic function, such as :mmintrin.h
>
>Hi, experts:
>I have a question about using compiler’s intrinsic function.
>It seems EDKII’s compiler option doesn’t support using intrinsic function.
>
>Such as:
>mmintrin.h      MMX
>xmmintrin.h    SSE
>emmintrin.h   SSE2
>pmmintrin.h   SSE3
>tmmintrin.h    SSSE3
>intrin.h             SSE4A
>smmintrin.h   SSE4.1
>nmmintrin.h   SSE4.2
>mm3dnow.h  3DNOW
>
>Thanks
>
>Best wishes,
>
>
>保密声明:
>本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其
>内容做任何未经授权的查阅、使用、复制或转发。
>CONFIDENTIAL NOTE:
>This email contains confidential or legally privileged information and
>is for the sole use of its intended recipient. Any unauthorized review,
>use, copying or forwarding of this email or the content of this email is strictly prohibited.
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel


保密声明:
本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容做任何未经授权的查阅、使用、复制或转发。
CONFIDENTIAL NOTE:
This email contains confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized review, use, copying or forwarding of this email or the content of this email is strictly prohibited.

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: How to use compiler intrinsic function, such as :mmintrin.h
@ 2018-02-06  8:53 Tiger Liu(BJ-RD)
  0 siblings, 0 replies; 6+ messages in thread
From: Tiger Liu(BJ-RD) @ 2018-02-06  8:53 UTC (permalink / raw)
  To: afish@apple.com; +Cc: Gao, Liming, edk2-devel@lists.01.org

Hi, Andrew:
Thanks a lot!

Best wishes,
发件人: afish@apple.com [mailto:afish@apple.com]
发送时间: 2018年2月6日 13:01
收件人: Tiger Liu(BJ-RD) <TigerLiu@zhaoxin.com>
抄送: Gao, Liming <liming.gao@intel.com>; edk2-devel@lists.01.org
主题: Re: [edk2] [EDK2] How to use compiler intrinsic function, such as :mmintrin.h

Technically speaking the compiler generates the code for the intrinsics but the compiler specific include files generally don't just work as they are built to included in the context of that compilers C lib.

I've had some luck using intrinsics from clang, but you have to:
1) Make your own version of the intrinsic header porting it to the edk2 type system, or use portable types.
  a) You also need to realized the intrinsics are compiler specific. Generally there is the VC++ and GCC flavors of intrinsics.
  b) The intrinsics can also be CPU architecture specific.
2) You can override compiler flags at a driver or library level via the [BuildOptions]section: https://github.com/tianocore/edk2/blob/master/EmulatorPkg/Unix/Host/Host.inf
3) You need to realize the edk2 is not doing the setup for you. So you have to do the CPU ID checks, or turn on the modes required for some things to be valid. Don't cause exceptions as there is no code to handle it. Etc.

Thanks,

Andrew Fish



On Feb 5, 2018, at 8:57 PM, Tiger Liu(BJ-RD) <TigerLiu@zhaoxin.com<mailto:TigerLiu@zhaoxin.com>> wrote:

Hi, Liming:
Thanks for your reply.
I tried to compile a UEFI shell application.
And this app would call functions provided in mmintrin.h

So, I met this trouble.

Thanks

Best wishes,
-----邮件原件-----
发件人: Gao, Liming [mailto:liming.gao@intel.com]
发送时间: 2018年2月6日 12:39
收件人: Tiger Liu(BJ-RD) <TigerLiu@zhaoxin.com<mailto:TigerLiu@zhaoxin.com>>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
主题: RE: [edk2] [EDK2] How to use compiler intrinsic function, such as :mmintrin.h

Tiger:
 Yes. EDK2 doesn't support the intrinsic function. Because edk2 compiled EFI image run in target machine instead of OS, they can't link VS system libraries.

 And, EDK2 doesn't support to specify the include path in BuildOptions. If you want to use EDK2 build system to compile EXE file that run in OS, such as SecMain, you can compile it with system header file and library. The system header file include path is set in ENV include. If you type set include, you will se its value.

Thanks
Liming

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
Tiger Liu(BJ-RD)
Sent: Monday, February 05, 2018 5:06 PM
To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Subject: Re: [edk2] [EDK2] How to use compiler intrinsic function, such
as :mmintrin.h

Hi, experts:
I have a question about how to direct compiler to search dedicated
include directory.
Such as:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include

I tried to tell  compiler through “/I” parameter.
“/I C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include”

But failed.

Best wishes,
发件人: Tiger Liu(BJ-RD)
发送时间: 2018年2月2日 19:08
收件人: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
主题: [EDK2] How to use compiler intrinsic function, such as :mmintrin.h

Hi, experts:
I have a question about using compiler’s intrinsic function.
It seems EDKII’s compiler option doesn’t support using intrinsic function.

Such as:
mmintrin.h      MMX
xmmintrin.h    SSE
emmintrin.h   SSE2
pmmintrin.h   SSE3
tmmintrin.h    SSSE3
intrin.h             SSE4A
smmintrin.h   SSE4.1
nmmintrin.h   SSE4.2
mm3dnow.h  3DNOW

Thanks

Best wishes,


保密声明:
本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其
内容做任何未经授权的查阅、使用、复制或转发。
CONFIDENTIAL NOTE:
This email contains confidential or legally privileged information and
is for the sole use of its intended recipient. Any unauthorized review,
use, copying or forwarding of this email or the content of this email is strictly prohibited.
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
https://lists.01.org/mailman/listinfo/edk2-devel


保密声明:
本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容做任何未经授权的查阅、使用、复制或转发。
CONFIDENTIAL NOTE:
This email contains confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized review, use, copying or forwarding of this email or the content of this email is strictly prohibited.
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
https://lists.01.org/mailman/listinfo/edk2-devel



保密声明:
本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容做任何未经授权的查阅、使用、复制或转发。
CONFIDENTIAL NOTE:
This email contains confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized review, use, copying or forwarding of this email or the content of this email is strictly prohibited.

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

end of thread, other threads:[~2018-02-06  8:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-02 11:08 How to use compiler intrinsic function, such as :mmintrin.h Tiger Liu(BJ-RD)
  -- strict thread matches above, loose matches on Subject: below --
2018-02-05  9:05 Tiger Liu(BJ-RD)
2018-02-06  4:39 ` Gao, Liming
2018-02-06  4:57 Tiger Liu(BJ-RD)
2018-02-06  5:00 ` Andrew Fish
2018-02-06  8:53 Tiger Liu(BJ-RD)

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