Use q modifier for XMM portion of an YMM register?

Adam Warner lists@consulting.net.nz
Thu Sep 1 08:11:00 GMT 2016


Hello all,

This seems to work:

#include <stdint.h>

typedef uint64_t u64x4_t __attribute__ ((vector_size (32)));

int main(void) {
  register u64x4_t abcd asm("ymm0");
  register u64x4_t efgh asm("ymm1");

  asm volatile ("vextractf128 $1, %1, %q0" : "=x" (abcd) : "x" (efgh));
}

$ gcc-snapshot.sh -O3 -mavx q-modifier.c
$ objdump -d -m i386:x86-64:intel a.out |less
...
c4 e3 7d 19 c8 01       vextractf128 xmm0,ymm1,0x1
...

If the approach is correct I could inform the clang project of the syntax 
(it's an internal compiler error in clang-3.9).

Regards,
Adam Warner



More information about the Gcc-help mailing list