Vector Class Discussion

patch: xgetbv on gcc<4.4
Author:  Date: 2014-04-23 13:20
I think this is what you want. The __GNUC_PREREQ caused a Mac/clang problem. I've tested on Mac 10.9.2, RHEL5, and RHEL6.

diff --git a/instrset_detect.cpp b/instrset_detect.cpp
--- a/instrset_detect.cpp
+++ b/instrset_detect.cpp
@@ -54,7 +54,11 @@
#elif defined(__GNUC__) // use inline assembly, Gnu/AT&T syntax

uint32_t a, d;
+#if __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4
__asm("xgetbv" : "=a"(a),"=d"(d) : "c"(ctr) : );
+#else
+ __asm(".byte 0x0f, 0x01, 0xd0" : "=a"(a),"=d"(d) : "c"(ctr) : );
+#endif
return a | (uint64_t(d) << 32);

 
thread patch: xgetbv on gcc<4.4 new - Greg Allen - 2014-04-22
last replythread patch: xgetbv on gcc<4.4 new - Agner - 2014-04-22
last reply patch: xgetbv on gcc<4.4 - Greg Allen - 2014-04-23