diff options
| author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2010-07-09 18:27:43 +0000 |
|---|---|---|
| committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2010-07-09 18:27:43 +0000 |
| commit | 792e906bef26768970349a019cdb87aeddd06772 (patch) | |
| tree | 0e6a2bdb2568c6a17faea8008782f3fff0512e86 /llvm/lib/Target/X86/X86MCCodeEmitter.cpp | |
| parent | 8014df4c21d8ed8acd6f14b58b96aaf1cd4bc8cc (diff) | |
| download | bcm5719-llvm-792e906bef26768970349a019cdb87aeddd06772.tar.gz bcm5719-llvm-792e906bef26768970349a019cdb87aeddd06772.zip | |
Start the support for AVX instructions with 256-bit %ymm registers. A couple of
notes:
- The instructions are being added with dummy placeholder patterns using some 256
specifiers, this is not meant to work now, but since there are some multiclasses
generic enough to accept them, when we go for codegen, the stuff will be already
there.
- Add VEX encoding bits to support YMM
- Add MOVUPS and MOVAPS in the first round
- Use "Y" as suffix for those Instructions: MOVUPSYrr, ...
- All AVX instructions in X86InstrSSE.td will move soon to a new X86InstrAVX
file.
llvm-svn: 107996
Diffstat (limited to 'llvm/lib/Target/X86/X86MCCodeEmitter.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86MCCodeEmitter.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86MCCodeEmitter.cpp b/llvm/lib/Target/X86/X86MCCodeEmitter.cpp index 943284a47ee..633ddd49d74 100644 --- a/llvm/lib/Target/X86/X86MCCodeEmitter.cpp +++ b/llvm/lib/Target/X86/X86MCCodeEmitter.cpp @@ -75,7 +75,8 @@ public: unsigned OpNum) { unsigned SrcReg = MI.getOperand(OpNum).getReg(); unsigned SrcRegNum = GetX86RegNum(MI.getOperand(OpNum)); - if (SrcReg >= X86::XMM8 && SrcReg <= X86::XMM15) + if ((SrcReg >= X86::XMM8 && SrcReg <= X86::XMM15) || + (SrcReg >= X86::YMM8 && SrcReg <= X86::YMM15)) SrcRegNum += 8; // The registers represented through VEX_VVVV should @@ -454,6 +455,15 @@ void X86MCCodeEmitter::EmitVEXOpcodePrefix(uint64_t TSFlags, unsigned &CurByte, break; // No prefix! } + // Set the vector length to 256-bit if YMM0-YMM15 is used + for (unsigned i = 0; i != MI.getNumOperands(); ++i) { + if (!MI.getOperand(i).isReg()) + continue; + unsigned SrcReg = MI.getOperand(i).getReg(); + if (SrcReg >= X86::YMM0 && SrcReg <= X86::YMM15) + VEX_L = 1; + } + unsigned NumOps = MI.getNumOperands(); unsigned CurOp = 0; |

