From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 4A96821951CB5 for ; Tue, 2 May 2017 08:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1493737935; 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=Rzpyb/b/79ug6Y7+b7L2ugxon9r8zbhNf5zYN/I6tBg=; b=cOaOtIVp207z7TcqeJ8yuGPz1v17FO6j1RuzbTzkvguCuxvLe1CcKGHSNkr2Fjm2 WxDapITg6RWwKI8Fpmlo4oa90totkK2FlfQ92pNyK6VR6pybISLrDfIAByQNM/FI 7oqh35T4yFG1sAQG0GEnGgz4htrmxG74Ul+kZvv3f6KXCVfoMkYkfnqsce7Ah36J fkHXsvsAvpTdOmViW71iPbm2rnmajJVK8WrSMvNAg6+r/fTyYCOfRl8jF+PlS1p3 STGar3afcBnsYtaJFRe74RrfXnPNoK2lHMIM8jTyPlJTRrWA8GiaaNGohJGuJ9Re etsEgNkPV1EVLIljbwUKFQ==; Received: from relay4.apple.com (relay4.apple.com [17.128.113.87]) (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 62.B2.25795.FC1A8095; Tue, 2 May 2017 08:12:15 -0700 (PDT) X-AuditID: 11973e13-4cd389a0000064c3-eb-5908a1cfbabd Received: from nwk-mmpp-sz10.apple.com (nwk-mmpp-sz10.apple.com [17.128.115.122]) by relay4.apple.com (Apple SCV relay) with SMTP id 35.E3.02523.FC1A8095; Tue, 2 May 2017 08:12:15 -0700 (PDT) MIME-version: 1.0 Received: from [17.153.90.199] (unknown [17.153.90.199]) by nwk-mmpp-sz10.apple.com (Oracle Communications Messaging Server 8.0.1.2.20170210 64bit (built Feb 10 2017)) with ESMTPSA id <0OPB009C2ZKFO120@nwk-mmpp-sz10.apple.com>; Tue, 02 May 2017 08:12:15 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish In-reply-to: Date: Tue, 02 May 2017 08:12:14 -0700 Cc: "edk2-devel@lists.01.org" Message-id: <0E40AA0F-3FDD-420D-9982-43FB8E0DE81A@apple.com> References: To: Amit kumar X-Mailer: Apple Mail (2.3273) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFLMWRmVeSWpSXmKPExsUi2FAYrnt+IUekwbk5Fhb7Xu9ksthz6Ciz A5PH454zbB7ds/+xBDBFcdmkpOZklqUW6dslcGWsW9/BXvCTo2Le3lXsDYxN7F2MHBwSAiYS c5/kdjFycQgJrGaSOPWpjaWLkRMs3j/rFCNE4hCjxMGVr9lAErwCghI/Jt9jAWlmFpCXOHhe FiTMLKAl8f1RKwtE/UQmiR2vnzKBJIQFxCXendnEDGHbSLzu+we2gE1AWWLF/A/sIDanQLzE 4/P7wepZBFQl9rXPYIEYai4x48IXJoi9NhKd67aA3SAkECex6nAjWI0IUH1/+xR2iKNlJW7N vsQMcoSEwBI2iWUbXrBNYBSeheTuWQh3z0Jy9wJG5lWMQrmJmTm6mXmmeokFBTmpesn5uZsY QYE93U54B+PpVVaHGAU4GJV4eB9M4IgUYk0sK67MPcQozcGiJM5bzMUWKSSQnliSmp2aWpBa FF9UmpNafIiRiYNTqoHRN6t+itnjGu2rv2fLS+7I2Vx1fD0/R3H7DPl20ezmx1IzTz+e3+to 9W6u4CyN2e9VFXnnpq/bKBz58lLOH589ZbUx585IVlfJX5a5lbSykCPjjU67T0GkoEnqxuD0 BQ8iuq02Mmq+2CCqlXP4u/qbeza5RTN37i3effHR40n3hdPXSSd45TAqsRRnJBpqMRcVJwIA RW5Ng00CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeLIzCtJLcpLzFFi42IRbCiu0j2/kCPSYO1rE4t9r3cyWew5dJTZ gcnjcc8ZNo/u2f9YApiiuGxSUnMyy1KL9O0SuDLWre9gL/jJUTFv7yr2BsYm9i5GTg4JAROJ /lmnGLsYuTiEBA4xShxc+ZoNJMErICjxY/I9li5GDg5mAXmJg+dlQcLMAloS3x+1skDUT2SS 2PH6KRNIQlhAXOLdmU3MELaNxOu+fywgNpuAssSK+R/AlnEKxEs8Pr8frJ5FQFViX/sMFoih 5hIzLnxhgthrI9G5bgvYDUICcRKrDjeC1YgA1fe3T4E6Wlbi1uxLzBMYBWYhOXUWwqmzkJy6 gJF5FaNAUWpOYqWJXmJBQU6qXnJ+7iZGcCgWhu9g/LfM6hCjAAejEg+vxWSOSCHWxLLiylxg WHAwK4nwzloAFOJNSaysSi3Kjy8qzUktPsRYBXT/RGYp0eR8YJzklcQbmpgYmBgbmxkbm5uY U0VYSZx3WjZTpJBAemJJanZqakFqEcxyJg5OqQbGrJI/rYe5Lp9482xPfFtYya9Nq6/uPnRw 01NJMd/bH/g9Ohf3eK3I8lfIu77yaqC8W+oTnY0v1V90eBZN6shk/v4vRUcpfq5KYFywMw9/ Sc1Sru+mLnvr/I9mfJ9zWDTar3aj2aJskblmWapzGQIXuRQ/uBgwf/e3qXwvNmwrl+0+vvyS 8v+ZSizFGYmGWsxFxYkAZ64jbKACAAA= Subject: Re: Accessing AVX/AVX2 instruction in UEFI. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 15:12:16 -0000 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII > On May 2, 2017, at 6:57 AM, Amit kumar wrote: > > Hi, > > Am trying to optimize an application using AVX/AVX2, but my code hangs while trying to access YMM registers. > The instruction where my code hangs is : > > > vmovups ymm0, YMMWORD PTR [rax] > > > I have verified the cpuid in OS and it supports AVX and AVX2 instruction. Processor i7 6th gen. > Can somebody help me out here ? Is there a way to enable YMM registers ? > Amit, I think these instructions will generate an illegal instruction fault until you enable AVX. You need to check the Cpu ID bits in your code, then write BIT18 of CR4. After that XGETBV/XSETBV instructions are enabled and you can or in the lower 2 bits of XCR0. This basic operation is in the Intel Docs, it is just hard to find. Usually the OS has done this for the programmer and all the code needs to do is check the CPU ID. Thanks, Andrew Fish > > Thanks And Regards > Amit Kumar > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel