It is sometimes said that Ideone is using a cube cluster, but it is not true.
Here are the cpuids (eax=1) of these clusters:
- Ideone: ecx=0x00802009, edx=0x178BFBFF
- Cube: ecx=0x0D9AE3BF, edx=0xBFEBFBFF
(see http://en.wikipedia.org/wiki/CPUID)
You can confirm them using the following code:
[bbone=cpp,771]
include
include
int main() {
unsigned eax, ebx, ecx, edx;
__cpuid(1, eax, ebx, ecx, edx);
printf("%08lx %08lx %08lx %08lx\n", eax, ebx, ecx, edx);
return 0;
}
[/bbone]
That is, you can use SSSE3, SSE4.1 and SSE4.2 in a cube cluster, but you cannot use them on Ideone.
For example, the following code works in a cube cluster, but it does not in Ideone.
[bbone=cpp,772]
include
typedef long long int64;
int64 a[2] attribute((aligned(16)));
int64 b[2] attribute((aligned(16)));
int main() {
scanf("%lld %lld", &a[0], &b[0]);
asm(
"movdqa (%0), %%xmm0;"
"movdqa (%1), %%xmm1;"
"pcmpgtq %%xmm1, %%xmm0;" // SSE 4.2
"movdqa %%xmm0, (%0);"
:
: "r"(a), "r"(b)
);
// a[0] = (a[0] > b[0] ? -1 : 0);
// a[1] = (a[1] > b[1] ? -1 : 0);
printf("%lld\n", a[0]);
return 0;
}
[/bbone]
By the way, you can use MMX, SSE, SSE2 and SSE3 in both clusters (by using the inline assembler).