mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
[x86] Assert on invalid immediates in the instruction printer for cmp.ps/pd/ss/sd instead of truncating the immediate. The assembly parser and instruction selection shouldn't generate invalid immediates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224886 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6ba84e58da
commit
3e9bf4c0d0
@ -112,13 +112,15 @@ static void printSSEAVXCC(int64_t Imm, raw_ostream &O) {
|
||||
|
||||
void X86ATTInstPrinter::printSSECC(const MCInst *MI, unsigned Op,
|
||||
raw_ostream &O) {
|
||||
int64_t Imm = MI->getOperand(Op).getImm() & 0x7;
|
||||
int64_t Imm = MI->getOperand(Op).getImm();
|
||||
assert((Imm & 0x7) == Imm); // Ensure valid immediate.
|
||||
printSSEAVXCC(Imm, O);
|
||||
}
|
||||
|
||||
void X86ATTInstPrinter::printAVXCC(const MCInst *MI, unsigned Op,
|
||||
raw_ostream &O) {
|
||||
int64_t Imm = MI->getOperand(Op).getImm() & 0x1f;
|
||||
int64_t Imm = MI->getOperand(Op).getImm();
|
||||
assert((Imm & 0x1f) == Imm); // Ensure valid immediate.
|
||||
printSSEAVXCC(Imm, O);
|
||||
}
|
||||
|
||||
|
@ -90,13 +90,15 @@ static void printSSEAVXCC(int64_t Imm, raw_ostream &O) {
|
||||
|
||||
void X86IntelInstPrinter::printSSECC(const MCInst *MI, unsigned Op,
|
||||
raw_ostream &O) {
|
||||
int64_t Imm = MI->getOperand(Op).getImm() & 0x7;
|
||||
int64_t Imm = MI->getOperand(Op).getImm();
|
||||
assert((Imm & 0x7) == Imm); // Ensure valid immediate.
|
||||
printSSEAVXCC(Imm, O);
|
||||
}
|
||||
|
||||
void X86IntelInstPrinter::printAVXCC(const MCInst *MI, unsigned Op,
|
||||
raw_ostream &O) {
|
||||
int64_t Imm = MI->getOperand(Op).getImm() & 0x1f;
|
||||
int64_t Imm = MI->getOperand(Op).getImm();
|
||||
assert((Imm & 0x1f) == Imm); // Ensure valid immediate.
|
||||
printSSEAVXCC(Imm, O);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user