https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
MMX instructions should be disallowed in interrupt handler:

[hjl@gnu-6 interrupt-1]$ cat m.i 
typedef short __v4hi __attribute__ ((__vector_size__ (8)));
typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));

extern __m64 y, x;

void
__attribute__((interrupt))
fn1 (void)
{
  x = (__m64) __builtin_ia32_packsswb ((__v4hi) x, (__v4hi) y);
}
[hjl@gnu-6 interrupt-1]$ make m.s
/export/build/gnu/gcc-5/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-5/build-x86_64-linux/gcc/ -O2 -S -o m.s m.i
[hjl@gnu-6 interrupt-1]$ cat m.s
        .file   "m.i"
        .section        .text.unlikely,"ax",@progbits
.LCOLDB0:
        .text
.LHOTB0:
        .p2align 4,,15
        .globl  fn1
        .type   fn1, @function
fn1:
.LFB0:
        .cfi_startproc
        movq    x(%rip), %mm0
        addq    $-128, %rsp
        packsswb        y(%rip), %mm0
        movq    %mm0, x(%rip)
        ret
        .cfi_endproc
.LFE0:
        .size   fn1, .-fn1
        .section        .text.unlikely
.LCOLDE0:
        .text
.LHOTE0:
        .ident  "GCC: (GNU) 5.2.1 20150911"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-6 interrupt-1]$

Reply via email to