|
From: Andrew S. <ver...@ya...> - 2013-07-09 11:24:11
|
Hi Gisle,
"I believe 'vmovd xmm0..' is an Intel AVX instruction. Running this on a CPU w/o AVX
would off-course trigger an 'illegal instruction'."
I see. I'm using an AMD-8150 FX processor. Do you know if there is a flag I could set
to generate code for AMD specific XOP instructions? I'm a little confused why the AVX
instruction even shows up though (I thought I was using XOP instructions not AVX), plus
I thought AVX was supported by AMD too. I checked CPUID through CPU-Z, the 8150
has:
MMX(+), SSE(1,2,3,3S,4.1,4.2,4A), x86-64, AMD-V, AES,AVX,XOP
Also should I wrap my code around with ( is this even possible for different manufacturers btw)?
#ifdef SOME INTEL TAG FOR INTEL CPUS
//insert intel cpu only code here.
#endif
Any other suggestions would be helpful.
thanks,
Andrew
________________________________
From: Gisle Vanem <gv...@br...>
To: MinGW Users List <min...@li...>
Sent: Tuesday, July 9, 2013 3:56 AM
Subject: Re: [Mingw-users] An error regarding AMD-XOP and emmintrin.h?
"Andrew Somorjai" <ver...@ya...> wrote:
------------
I'm using GCC-TDM 4.7.1-2 and I tried to compile the following code using GCC with the compiler flags -msse3 -msse4 -mxop but there
seems to be a problem only
if the header x86intrin.h is included.
If I run the code through GDB I get a seg fault in emmintrin.h on line 603 where it says:
return __extension__ (__m128i)(__v16qi){
If I comment out x86intrin.h I can run the program with the line
__m128i HADDQinput = _mm_set_epi8(4, 3, 2, 1, 8, 7, 5, 3, 7, 6, 5, 4, 9, 0, 3, 3); //line 14
no trouble. Its only when x86intrin.h is compiled with the source below a crash occurs.
#include <emmintrin.h>
#include <x86intrin.h>//code compiles and runs fine without this header but otherwise causes a seg fault in emmintrin.h line 603
#include <stdio.h>
#include <stdint.h>
void print_2_64_bit_ints(const char * label, __m128i m64_r)
{
int *val = (int *) &m64_r;
printf("%s: %d %d\n",
label, val[0], val[1]);
}
int main()
{
__m128i HADDQinput = _mm_set_epi8(4, 3, 2, 1, 8, 7, 5, 3, 7, 6, 5, 4, 9, 0, 3, 3);//line 14
//__m128i RESULT = _mm_haddq_epi8(HADDQinput);
//_mm_empty();
//print_2_64_bit_ints("Result ", RESULT);
return 0;
}
thanks,
------------
I tried your program here. WinDbg says:
(14f8.1524): Illegal instruction - code c000001d
...
mmx_gcc+0x1454:
00401454 c5f96e44243c vmovd xmm0,dword ptr [esp+3Ch] ss:0023:0022fefc=00000003
I believe 'vmovd xmm0..' is an Intel AVX instruction. Running this on a CPU w/o AVX
would off-course trigger an 'illegal instruction'.
Ref. http://en.wikipedia.org/wiki/Advanced_Vector_Extensions
--gv
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
MinGW-users mailing list
Min...@li...
This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:min...@li...?subject=unsubscribe |