mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Diagnose invalid alignments on duplicating VLDn instructions.
Patch by Chris Lidbury. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163323 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
eae1d34029
commit
24b9f258f1
@ -2701,6 +2701,8 @@ static DecodeStatus DecodeVLD1DupInstruction(MCInst &Inst, unsigned Insn,
|
||||
unsigned align = fieldFromInstruction(Insn, 4, 1);
|
||||
unsigned size = fieldFromInstruction(Insn, 6, 2);
|
||||
|
||||
if (size == 0 && align == 1)
|
||||
return MCDisassembler::Fail;
|
||||
align *= (1 << size);
|
||||
|
||||
switch (Inst.getOpcode()) {
|
||||
@ -2831,6 +2833,8 @@ static DecodeStatus DecodeVLD4DupInstruction(MCInst &Inst, unsigned Insn,
|
||||
unsigned align = fieldFromInstruction(Insn, 4, 1);
|
||||
|
||||
if (size == 0x3) {
|
||||
if (align == 0)
|
||||
return MCDisassembler::Fail;
|
||||
size = 4;
|
||||
align = 16;
|
||||
} else {
|
||||
|
@ -1,5 +1,4 @@
|
||||
# RUN: llvm-mc --disassemble %s -triple=armv7-unknown-unknwon -mcpu=cortex-a8 2>&1 | grep "invalid instruction encoding"
|
||||
# XFAIL: *
|
||||
# RUN: llvm-mc --disassemble %s -triple=armv7-unknown-unknwon -mcpu=cortex-a8 2>&1 | FileCheck %s
|
||||
|
||||
# Opcode=737 Name=VLD1DUPq8_UPD Format=ARM_FORMAT_NLdSt(30)
|
||||
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||
@ -9,3 +8,4 @@
|
||||
#
|
||||
# 'a' == 1 and data_size == 8 is invalid
|
||||
0x3d 0x3c 0xa0 0xf4
|
||||
# CHECK: invalid instruction encoding
|
||||
|
@ -0,0 +1,4 @@
|
||||
# RUN: llvm-mc -triple thumbv7 -show-encoding -disassemble < %s 2>&1 | FileCheck %s
|
||||
|
||||
0xa0 0xf9 0xc0 0x0f
|
||||
# CHECK: invalid instruction encoding
|
Loading…
x
Reference in New Issue
Block a user