bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/15708] Illegal instruction with -mavx


From: oysteijo at gmail dot com
Subject: [Bug gas/15708] Illegal instruction with -mavx
Date: Mon, 01 Jul 2013 17:17:04 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=15708



--- Comment #3 from Øystein Schønning-Johansen <oysteijo at gmail
 dot com> ---

Hmmmmmm......



I think the problem may be the runtime library and not the assembler as I

assumed.



The main problem is that the OS is to old for the hardware: 



$ cat /etc/redhat-release 

Red Hat Enterprise Linux Client release 5.8 (Tikanga)



$ uname -a

Linux st-test-hp-z820 2.6.18-308.el5 #1 SMP Fri Jan 27 17:17:51 EST 2012 x8
6_64

x86_64 x86_64 GNU/Linux



Here's a test program:

$ cat avxtest.c 

#include <stdio.h>

#include <cpuid.h>



int main()

{

        unsigned int eax = 1, ebx, ecx, edx;

        __get_cpuid( 1, &eax, &ebx, &ecx, &edx );

        printf("AVX: %s\n", ( ecx & bit_AVX  ) ? "YES!" : "Sorry." );

        return 0;

}



$ gcc -o avxtest avxtest.c && ./avxtest

AVX: YES!



But then:

$ cat /proc/cpuinfo | grep flags | tail -1

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov

pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx pdpe1gb rd
tscp

lm constant_tsc ida nonstop_tsc arat pni monitor ds_cpl vmx smx est tm2 sss
e3

cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm



No AVX on that list.....?



Disassemby:

(gdb) disass

Dump of assembler code for function main:

0x0000000000400520 <main+0>:    push   %rbp

0x0000000000400521 <main+1>:    mov    %rsp,%rbp

0x0000000000400524 <main+4>:    sub    $0x10,%rsp

0x0000000000400528 <main+8>:    mov    0x11e(%rip),%eax        # 0x40064c

0x000000000040052e <main+14>:   mov    %eax,-0x4(%rbp)

0x0000000000400531 <main+17>:   vmovss -0x4(%rbp),%xmm0

0x0000000000400536 <main+22>:   vcvtps2pd %xmm0,%xmm0

0x000000000040053a <main+26>:   mov    $0x40063c,%edi

0x000000000040053f <main+31>:   mov    $0x1,%eax

0x0000000000400544 <main+36>:   callq  0x4003a0 <address@hidden>

0x0000000000400549 <main+41>:   mov    $0x0,%eax

0x000000000040054e <main+46>:   leaveq 

0x000000000040054f <main+47>:   retq   

End of assembler dump.



Could it be something incompatible to the runtime libraries:

$ ldd mytest

        linux-vdso.so.1 =>  (0x00007fffe6dfd000)

        libc.so.6 => /lib64/libc.so.6 (0x000000355e800000)

        /lib64/ld-linux-x86-64.so.2 (0x000000355e400000)



Thanks,

-Øystein



-- 

You are receiving this mail because:

You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]