public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/iains/heads/d-for-darwin)] libphobos: Use raw byte sequence instead of xgetbv
@ 2020-12-21 20:36 Iain D Sandoe
  0 siblings, 0 replies; 2+ messages in thread
From: Iain D Sandoe @ 2020-12-21 20:36 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:10b794b9c8171dcd61ee05830924422fe7d5e39e

commit 10b794b9c8171dcd61ee05830924422fe7d5e39e
Author: Iain Buclaw <ibuclaw@gdcproject.org>
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;


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

* [gcc(refs/users/iains/heads/d-for-darwin)] libphobos: Use raw byte sequence instead of xgetbv
@ 2020-12-13 17:43 Iain D Sandoe
  0 siblings, 0 replies; 2+ messages in thread
From: Iain D Sandoe @ 2020-12-13 17:43 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:222a1b15370310a25c39a3aba4d5e6d3cd53d586

commit 222a1b15370310a25c39a3aba4d5e6d3cd53d586
Author: Iain Buclaw <ibuclaw@gdcproject.org>
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;


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

end of thread, other threads:[~2020-12-21 20:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-21 20:36 [gcc(refs/users/iains/heads/d-for-darwin)] libphobos: Use raw byte sequence instead of xgetbv Iain D Sandoe
  -- strict thread matches above, loose matches on Subject: below --
2020-12-13 17:43 Iain D Sandoe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).