From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=17.151.62.27; helo=mail-in5.apple.com; envelope-from=afish@apple.com; receiver=edk2-devel@lists.01.org Received: from mail-in5.apple.com (mail-out5.apple.com [17.151.62.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 01AFE21F0DA45 for ; Mon, 5 Feb 2018 20:54:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1517893234; x=2381806834; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4AJC0b3iWl0ZaaPEwCyjfIp8FUfyX9g3iT/iEpDqpoo=; b=koT+gZfieC9rzsKHBTnGKJrK/q9kDex6F5eFWtGKXq5ofm+XgoasKQQI/mRLlIFZ wq11QJRzdYkt2gE/xZDjYSJh6CjFrn2uQq7otMT2ZnyqJRUYoSZ4vp50He09GiY3 xg7+vKKVdBpl/TG/KE9WsocFX6LhDGLAsSE+nrCvuhy3+ZO07UXBy8o1loG0N1uH vbvE6kR8K29zJfzsJVeJ0cHyYbTlTKEyRcU3PespoaVoipnqrKhWWIC437WBjH/9 0aZjyIKRYQozJTI/0yMQ5TRBH0WkJlEMYzTc9A/a5ftaROjc6v+r5jEI5G62lEHv e4EZ+3q07S0WhP+vV8FGoQ==; Received: from relay2.apple.com (relay2.apple.com [17.128.113.67]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-in5.apple.com (Apple Secure Mail Relay) with SMTP id 42.D3.14264.276397A5; Mon, 5 Feb 2018 21:00:34 -0800 (PST) X-AuditID: 11973e13-066cc9e0000037b8-9e-5a793672e4c1 Received: from nwk-mmpp-sz11.apple.com (nwk-mmpp-sz11.apple.com [17.128.115.155]) by relay2.apple.com (Apple SCV relay) with SMTP id 3D.5C.26650.176397A5; Mon, 5 Feb 2018 21:00:33 -0800 (PST) MIME-version: 1.0 Received: from [17.234.100.248] by nwk-mmpp-sz11.apple.com (Oracle Communications Messaging Server 8.0.2.2.20180122 64bit (built Jan 22 2018)) with ESMTPSA id <0P3P00F5TPWXHH30@nwk-mmpp-sz11.apple.com>; Mon, 05 Feb 2018 21:00:33 -0800 (PST) Sender: afish@apple.com From: Andrew Fish Message-id: <78409F4A-A2DF-4225-B7AA-5F4D40E7C6FA@apple.com> Date: Mon, 05 Feb 2018 21:00:32 -0800 In-reply-to: <66939e06329e4309baa513094d9268f8@zhaoxin.com> Cc: "Gao, Liming" , "edk2-devel@lists.01.org" To: "Tiger Liu(BJ-RD)" References: <66939e06329e4309baa513094d9268f8@zhaoxin.com> X-Mailer: Apple Mail (2.3445.5.20) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsUi2FDorFtkVhllcOITo8WeQ0eZLVbc28Bu cWPWWiYHZo/Fe14yeXTP/sfi8evWLZYA5igum5TUnMyy1CJ9uwSujNbL+9gKZk1iqjh3cjFT A+PGT4xdjBwcEgImEk9OFnYxcnEICaxmkpg58zxTFyMnWHznia2MEIlDjBInnq9mB0nwCghK /Jh8jwXEZhYIk2iYMpsVougbo8SB8w/BioQFxCXendnEDGKzCShLrJj/AarZRuLbwn5GiJoI iXV7IWwWAVWJQ7feg9mcAtYS6043MUMsiJe48W0r2EUiAroSG+ddA1ssJGAlce7UehaIS5Uk pn+/zQZyhITAEjaJ+f9usE9gFJqF5NhZSI6dBfQ1s4C6xJQpuRBhbYkn7y6wQthqEgt/L2JC Fl/AyLaKUSg3MTNHNzPPVC+xoCAnVS85P3c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-Filtered-By: Mailman/MimeDel 2.1.23 Subject: Re: How to use compiler intrinsic function, such as :mmintrin.h X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Feb 2018 04:54:52 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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.=20 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.=20 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.i= nf 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.=20 Thanks, Andrew Fish > On Feb 5, 2018, at 8:57 PM, Tiger Liu(BJ-RD) = wrote: >=20 > Hi, Liming: > Thanks for your reply. > I tried to compile a UEFI shell application. > And this app would call functions provided in mmintrin.h >=20 > So, I met this trouble. >=20 > Thanks >=20 > Best wishes, > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Gao, Liming [mailto:liming.gao@intel.com = ] > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2018=E5=B9=B42=E6=9C=886=E6=97=A5 = 12:39 > =E6=94=B6=E4=BB=B6=E4=BA=BA: Tiger Liu(BJ-RD) >; edk2-devel@lists.01.org = > =E4=B8=BB=E9=A2=98: RE: [edk2] [EDK2] How to use compiler intrinsic = function, such as :mmintrin.h >=20 > 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. >=20 > 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. >=20 > 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 >>=20 >> 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 >>=20 >> I tried to tell compiler through =E2=80=9C/I=E2=80=9D parameter. >> =E2=80=9C/I C:\Program Files (x86)\Microsoft Visual Studio = 9.0\VC\include=E2=80=9D >>=20 >> But failed. >>=20 >> Best wishes, >> =E5=8F=91=E4=BB=B6=E4=BA=BA: Tiger Liu(BJ-RD) >> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2018=E5=B9=B42=E6=9C=882=E6=97=A5= 19:08 >> =E6=94=B6=E4=BB=B6=E4=BA=BA: edk2-devel@lists.01.org >> =E4=B8=BB=E9=A2=98: [EDK2] How to use compiler intrinsic function, = such as :mmintrin.h >>=20 >> Hi, experts: >> I have a question about using compiler=E2=80=99s intrinsic function. >> It seems EDKII=E2=80=99s compiler option doesn=E2=80=99t support = using intrinsic function. >>=20 >> 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 >>=20 >> Thanks >>=20 >> Best wishes, >>=20 >>=20 >> =E4=BF=9D=E5=AF=86=E5=A3=B0=E6=98=8E=EF=BC=9A >> = =E6=9C=AC=E9=82=AE=E4=BB=B6=E5=90=AB=E6=9C=89=E4=BF=9D=E5=AF=86=E6=88=96=E4= =B8=93=E6=9C=89=E4=BF=A1=E6=81=AF=EF=BC=8C=E4=BB=85=E4=BE=9B=E6=8C=87=E5=AE= =9A=E6=94=B6=E4=BB=B6=E4=BA=BA=E4=BD=BF=E7=94=A8=E3=80=82=E4=B8=A5=E7=A6=81= =E5=AF=B9=E6=9C=AC=E9=82=AE=E4=BB=B6=E6=88=96=E5=85=B6 >> =E5=86=85=E5=AE=B9=E5=81=9A=E4=BB=BB=E4=BD=95=E6=9C=AA=E7=BB=8F=E6=8E=88= =E6=9D=83=E7=9A=84=E6=9F=A5=E9=98=85=E3=80=81=E4=BD=BF=E7=94=A8=E3=80=81=E5= =A4=8D=E5=88=B6=E6=88=96=E8=BD=AC=E5=8F=91=E3=80=82 >> 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 >=20 >=20 > =E4=BF=9D=E5=AF=86=E5=A3=B0=E6=98=8E=EF=BC=9A > = =E6=9C=AC=E9=82=AE=E4=BB=B6=E5=90=AB=E6=9C=89=E4=BF=9D=E5=AF=86=E6=88=96=E4= =B8=93=E6=9C=89=E4=BF=A1=E6=81=AF=EF=BC=8C=E4=BB=85=E4=BE=9B=E6=8C=87=E5=AE= =9A=E6=94=B6=E4=BB=B6=E4=BA=BA=E4=BD=BF=E7=94=A8=E3=80=82=E4=B8=A5=E7=A6=81= =E5=AF=B9=E6=9C=AC=E9=82=AE=E4=BB=B6=E6=88=96=E5=85=B6=E5=86=85=E5=AE=B9=E5= =81=9A=E4=BB=BB=E4=BD=95=E6=9C=AA=E7=BB=8F=E6=8E=88=E6=9D=83=E7=9A=84=E6=9F= =A5=E9=98=85=E3=80=81=E4=BD=BF=E7=94=A8=E3=80=81=E5=A4=8D=E5=88=B6=E6=88=96= =E8=BD=AC=E5=8F=91=E3=80=82 > 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 =