From 589ddc9887406ddfd5a2661b567057faad7a22cc Mon Sep 17 00:00:00 2001 From: Richard Osborne Date: Sun, 5 May 2013 13:36:53 +0000 Subject: [PATCH] [XCore] Add LDAPB instructions. With the change the disassembler now supports the XCore ISA in its entirety. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181155 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/XCore/XCoreInstrInfo.td | 16 +++++++++++++--- test/MC/Disassembler/XCore/xcore.txt | 6 ++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/Target/XCore/XCoreInstrInfo.td b/lib/Target/XCore/XCoreInstrInfo.td index a4a339e9174..587166c1ce1 100644 --- a/lib/Target/XCore/XCoreInstrInfo.td +++ b/lib/Target/XCore/XCoreInstrInfo.td @@ -657,16 +657,26 @@ defm KRESTSP : FU6_LU6_np<0b0111101111, "krestsp">; // U10 -let Defs = [R11], isReMaterializable = 1, neverHasSideEffects = 1 in +let Defs = [R11], isReMaterializable = 1 in { +let neverHasSideEffects = 1 in def LDAPF_u10 : _FU10<0b110110, (outs), (ins pcrel_imm:$a), "ldap r11, $a", []>; -let Defs = [R11], isReMaterializable = 1 in def LDAPF_lu10 : _FLU10<0b110110, (outs), (ins pcrel_imm:$a), "ldap r11, $a", [(set R11, (pcrelwrapper tglobaladdr:$a))]>; -let Defs = [R11], isReMaterializable = 1, isCodeGenOnly = 1 in +let neverHasSideEffects = 1 in +def LDAPB_u10 : _FU10<0b110111, (outs), (ins pcrel_imm_neg:$a), "ldap r11, $a", + []>; + +let neverHasSideEffects = 1 in +def LDAPB_lu10 : _FLU10<0b110111, (outs), (ins pcrel_imm_neg:$a), + "ldap r11, $a", + [(set R11, (pcrelwrapper tglobaladdr:$a))]>; + +let isCodeGenOnly = 1 in def LDAPF_lu10_ba : _FLU10<0b110110, (outs), (ins pcrel_imm:$a), "ldap r11, $a", [(set R11, (pcrelwrapper tblockaddress:$a))]>; +} let isCall=1, // All calls clobber the link register and the non-callee-saved registers: diff --git a/test/MC/Disassembler/XCore/xcore.txt b/test/MC/Disassembler/XCore/xcore.txt index 311ca16767d..116433051a5 100644 --- a/test/MC/Disassembler/XCore/xcore.txt +++ b/test/MC/Disassembler/XCore/xcore.txt @@ -648,6 +648,12 @@ # CHECK: ldap r11, 53112 0x33 0xf0 0x78 0xdb +# CHECK: ldap r11, -22 +0x16 0xdc + +# CHECK: ldap r11, -9999 +0x09 0xf0 0x0f 0xdf + # CHECK: bl 8 0x08 0xd0