llvm.org GIT mirror llvm / 6b9f97d
Fix the bahavior of the disassembler when decoding unpredictable mrs instructions on ARM. Now the diasassembler emmits warnings instead of errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155002 91177308-0d34-0410-b5e6-96231b3b80d8 Silviu Baranga 7 years ago
2 changed file(s) with 36 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
46454645 //
46464646
46474647 // Move to ARM core register from Special Register
4648 def MRS : ABI<0b0001, (outs GPR:$Rd), (ins), NoItinerary,
4648 def MRS : ABI<0b0001, (outs GPRnopc:$Rd), (ins), NoItinerary,
46494649 "mrs", "\t$Rd, apsr", []> {
46504650 bits<4> Rd;
46514651 let Inst{23-16} = 0b00001111;
4652 let Unpredictable{19-17} = 0b111;
4653
46524654 let Inst{15-12} = Rd;
4653 let Inst{7-4} = 0b0000;
4654 }
4655
4656 def : InstAlias<"mrs${p} $Rd, cpsr", (MRS GPR:$Rd, pred:$p)>, Requires<[IsARM]>;
4657
4658 def MRSsys : ABI<0b0001, (outs GPR:$Rd), (ins), NoItinerary,
4655
4656 let Inst{11-0} = 0b000000000000;
4657 let Unpredictable{11-0} = 0b110100001111;
4658 }
4659
4660 def : InstAlias<"mrs${p} $Rd, cpsr", (MRS GPRnopc:$Rd, pred:$p)>, Requires<[IsARM]>;
4661
4662 // The MRSsys instruction is the MRS instruction from the ARM ARM,
4663 // section B9.3.9, with the R bit set to 1.
4664 def MRSsys : ABI<0b0001, (outs GPRnopc:$Rd), (ins), NoItinerary,
46594665 "mrs", "\t$Rd, spsr", []> {
46604666 bits<4> Rd;
46614667 let Inst{23-16} = 0b01001111;
4668 let Unpredictable{19-16} = 0b1111;
4669
46624670 let Inst{15-12} = Rd;
4663 let Inst{7-4} = 0b0000;
4671
4672 let Inst{11-0} = 0b000000000000;
4673 let Unpredictable{11-0} = 0b110100001111;
46644674 }
46654675
46664676 // Move from ARM core register to Special Register
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& FileCheck %s
1
2 # CHECK: warning: potentially undefined
3 # CHECK: 0x00 0xf0 0x0f 0x01
4 0x00 0xf0 0x0f 0x01
5
6 # CHECK: warning: potentially undefined
7 # CHECK: 0x00 0xf0 0x4f 0x01
8 0x00 0xf0 0x4f 0x01
9
10 # CHECK: warning: potentially undefined
11 # CHECK: 0x0f 0x0d 0x01 0x01
12 0x0f 0x0d 0x01 0x01
13
14 # CHECK: warning: potentially undefined
15 # CHECK: 0x0f 0x0d 0x40 0x01
16 0x0f 0x0d 0x40 0x01
17