Tracking down a problem with one of our benchmark codes, we've discovered that
some of the patterns in X86InstrX86-64.td are wrong. Specifically:
def MOV64toPQIrm : RPDI<0x6E, MRMSrcMem, (outs VR128:$dst), (ins i64mem:$src),
"mov{d|q}\t{$src, $dst|$dst, $src}",
[(set VR128:$dst,
(v2i64 (scalar_to_vector (loadi64 addr:$src))))]>;
def MOVPQIto64mr : RPDI<0x7E, MRMDestMem, (outs), (ins i64mem:$dst, VR128:
$src),
"mov{d|q}\t{$src, $dst|$dst, $src}",
[(store (i64 (vector_extract (v2i64 VR128:$src),
(iPTR 0))), addr:$dst)]>;
These say that for an AT&T-style assembler, output movd and for an Intel
assembler, output movq.
The problem is that such movs to and from memory must either use movq
or put a rex prefix before the movd. No such rex prefix appears in these
patterns, meaning the instructions will move 32 bits rather than 64 bits.
Bad things happen.
A little sleuthing uncovered this:
$ svn log -r32609
~/svn/test/official.llvm/llvm/lib/Target/X86/X86InstrX86-64.td