From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1873) id DD8453833029; Tue, 22 Dec 2020 13:40:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD8453833029 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Iain Buclaw To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Use raw byte sequence instead of xgetbv X-Act-Checkin: gcc X-Git-Author: Iain Buclaw X-Git-Refname: refs/users/ibuclaw/heads/darwin X-Git-Oldrev: 4440529d917793072925bbc97d9ba58a1de9acd7 X-Git-Newrev: 5629fd368f53a181177d0a82a22ec4c0789f367e Message-Id: <20201222134047.DD8453833029@sourceware.org> Date: Tue, 22 Dec 2020 13:40:47 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2020 13:40:48 -0000 https://gcc.gnu.org/g:5629fd368f53a181177d0a82a22ec4c0789f367e commit 5629fd368f53a181177d0a82a22ec4c0789f367e Author: Iain Buclaw Date: Thu Dec 3 23:52:11 2020 +0100 libphobos: Use raw byte sequence instead of xgetbv Diff: --- libphobos/libdruntime/core/cpuid.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libphobos/libdruntime/core/cpuid.d b/libphobos/libdruntime/core/cpuid.d index 2ba13b55bf1..109fd3b9efc 100644 --- a/libphobos/libdruntime/core/cpuid.d +++ b/libphobos/libdruntime/core/cpuid.d @@ -771,7 +771,10 @@ void cpuidX86() if (cf.miscfeatures & OSXSAVE_BIT) { version (GNU) asm pure nothrow @nogc { - "xgetbv" : "=a" (a), "=d" (d) : "c" (0); + /* Old assemblers do not recognize xgetbv, and there is no easy way + * to conditionally compile based on the assembler used, so use the + * raw .byte sequence instead. */ + ".byte 0x0f, 0x01, 0xd0" : "=a" (a), "=d" (d) : "c" (0); } else asm pure nothrow @nogc { mov ECX, 0; xgetbv;