From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id 4358C386F030; Mon, 21 Dec 2020 20:36:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4358C386F030 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/iains/heads/d-for-darwin)] libphobos: Use raw byte sequence instead of xgetbv X-Act-Checkin: gcc X-Git-Author: Iain Buclaw X-Git-Refname: refs/users/iains/heads/d-for-darwin X-Git-Oldrev: cb227eb0d06ef529489f45656022badce54ae52c X-Git-Newrev: 10b794b9c8171dcd61ee05830924422fe7d5e39e Message-Id: <20201221203622.4358C386F030@sourceware.org> Date: Mon, 21 Dec 2020 20:36:22 +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: Mon, 21 Dec 2020 20:36:22 -0000 https://gcc.gnu.org/g:10b794b9c8171dcd61ee05830924422fe7d5e39e commit 10b794b9c8171dcd61ee05830924422fe7d5e39e 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;