if(!(ecx & (1 << 27))) // not OSXSAVE
return 0;
uint32_t misc = ecx;
+ ass_get_xgetbv(0, &eax, &edx);
+ if((eax & 0x6) != 0x6)
+ return 0;
eax = 0;
ass_get_cpuid(&eax, &ebx, &ecx, &edx);
return (ecx & 0x6) == 0x6 ? (misc >> 28) & 0x1 : 0; // check high bits are relevant, then AVX support
mov [r4], edx
pop rbx
RET
+
+;-----------------------------------------------------------------------------
+; void get_xgetbv( uint32_t op, uint32_t *eax, uint32_t *edx )
+;-----------------------------------------------------------------------------
+
+INIT_XMM
+cglobal get_xgetbv, 3, 7, 0
+ push r2
+ push r1
+ mov ecx, r0d
+ xgetbv
+ pop r4
+ mov [r4], eax
+ pop r4
+ mov [r4], edx
+ RET
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-
+
#ifndef INTEL_CPUID_H
#define INTEL_CPUID_H
-
+
void ass_get_cpuid( uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
-
+void ass_get_xgetbv( uint32_t op, uint32_t *eax, uint32_t *edx );
+
#endif