From 17222df0ecf8b0fbcf17b050dd18174ca845fbe6 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sun, 31 Aug 2008 19:02:21 +0000 Subject: [PATCH] Addr2 word / byte load encodings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55591 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMInstrFormats.td | 22 +++++++++++++++++++++- lib/Target/ARM/ARMInstrInfo.td | 6 +++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/lib/Target/ARM/ARMInstrFormats.td b/lib/Target/ARM/ARMInstrFormats.td index ec600b4c2c1..7e6015dff57 100644 --- a/lib/Target/ARM/ARMInstrFormats.td +++ b/lib/Target/ARM/ARMInstrFormats.td @@ -135,10 +135,30 @@ class AsI1 opcod, dag oops, dag iops, Format f, string opc, let Inst{21-24} = opcod; let Inst{26-27} = 0; } + class AI2 opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : I; + asm, "", pattern> { + let Inst{26-27} = 1; +} +class AI2ldw opcod, dag oops, dag iops, Format f, string opc, + string asm, list pattern> + : AI2 { + let Inst{20} = 1; // load bit + let Inst{21} = 0; // W bit + let Inst{22} = 0; // B bit + let Inst{24} = 1; // P bit +} +class AI2ldb opcod, dag oops, dag iops, Format f, string opc, + string asm, list pattern> + : AI2 { + let Inst{20} = 1; // load bit + let Inst{21} = 0; // W bit + let Inst{22} = 1; // B bit + let Inst{24} = 1; // P bit +} + class AI3 opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : I; // Special LDR for loads from non-pc-relative constpools. let isSimpleLoad = 1, mayLoad = 1, isReMaterializable = 1 in -def LDRcp : AI2<0x0, (outs GPR:$dst), (ins addrmode2:$addr), LdFrm, +def LDRcp : AI2ldw<0x0, (outs GPR:$dst), (ins addrmode2:$addr), LdFrm, "ldr", " $dst, $addr", []>; // Loads with zero extension @@ -601,7 +601,7 @@ def LDRH : AI3<0xB, (outs GPR:$dst), (ins addrmode3:$addr), LdFrm, "ldr", "h $dst, $addr", [(set GPR:$dst, (zextloadi16 addrmode3:$addr))]>; -def LDRB : AI2<0x1, (outs GPR:$dst), (ins addrmode2:$addr), LdFrm, +def LDRB : AI2ldb<0x1, (outs GPR:$dst), (ins addrmode2:$addr), LdFrm, "ldr", "b $dst, $addr", [(set GPR:$dst, (zextloadi8 addrmode2:$addr))]>;