From c37532b24a2ff3dbb56dd506682bf323e47c1702 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Mon, 1 Sep 2008 07:34:13 +0000 Subject: [PATCH] AXI2 and AXI3 instruction encodings. llvm-svn: 55598 --- llvm/lib/Target/ARM/ARMInstrFormats.td | 84 ++++++++++++++++++++++++++ llvm/lib/Target/ARM/ARMInstrInfo.td | 20 +++--- 2 files changed, 94 insertions(+), 10 deletions(-) diff --git a/llvm/lib/Target/ARM/ARMInstrFormats.td b/llvm/lib/Target/ARM/ARMInstrFormats.td index 222dc38cf501..10153f68d025 100644 --- a/llvm/lib/Target/ARM/ARMInstrFormats.td +++ b/llvm/lib/Target/ARM/ARMInstrFormats.td @@ -191,6 +191,15 @@ class AI2ldw opcod, dag oops, dag iops, Format f, string opc, let Inst{22} = 0; // B bit let Inst{24} = 1; // P bit } +class AXI2ldw opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{20} = 1; // L 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 { @@ -199,6 +208,15 @@ class AI2ldb opcod, dag oops, dag iops, Format f, string opc, let Inst{22} = 1; // B bit let Inst{24} = 1; // P bit } +class AXI2ldb opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{20} = 1; // L bit + let Inst{21} = 0; // W bit + let Inst{22} = 1; // B bit + let Inst{24} = 1; // P bit +} // stores class AI2stw opcod, dag oops, dag iops, Format f, string opc, @@ -209,6 +227,15 @@ class AI2stw opcod, dag oops, dag iops, Format f, string opc, let Inst{22} = 0; // B bit let Inst{24} = 1; // P bit } +class AXI2stw opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{20} = 0; // L bit + let Inst{21} = 0; // W bit + let Inst{22} = 0; // B bit + let Inst{24} = 1; // P bit +} class AI2stb opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : AI2 { @@ -217,6 +244,15 @@ class AI2stb opcod, dag oops, dag iops, Format f, string opc, let Inst{22} = 1; // B bit let Inst{24} = 1; // P bit } +class AXI2stb opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{20} = 0; // L bit + let Inst{21} = 0; // W bit + let Inst{22} = 1; // B bit + let Inst{24} = 1; // P bit +} // Pre-indexed loads class AI2ldwpr opcod, dag oops, dag iops, Format f, string opc, @@ -321,6 +357,18 @@ class AI3ldh opcod, dag oops, dag iops, Format f, string opc, let Inst{21} = 0; // W bit let Inst{24} = 1; // P bit } +class AXI3ldh opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 0; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} class AI3ldsh opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : I opcod, dag oops, dag iops, Format f, string opc, let Inst{21} = 0; // W bit let Inst{24} = 1; // P bit } +class AXI3ldsh opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 1; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} class AI3ldsb opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : I opcod, dag oops, dag iops, Format f, string opc, let Inst{21} = 0; // W bit let Inst{24} = 1; // P bit } +class AXI3ldsb opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{4} = 1; + let Inst{5} = 0; // H bit + let Inst{6} = 1; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} class AI3ldd opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : I opcod, dag oops, dag iops, Format f, string opc, let Inst{21} = 0; // W bit let Inst{24} = 1; // P bit } +class AXI3sth opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 0; // S bit + let Inst{7} = 1; + let Inst{20} = 0; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} class AI3std opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : I; -def PICLDZH : AXI3<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), +def PICLDZH : AXI3ldh<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tldr${p}h $dst, $addr", [(set GPR:$dst, (zextloadi16 addrmodepc:$addr))]>; -def PICLDZB : AXI2<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), +def PICLDZB : AXI2ldb<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tldr${p}b $dst, $addr", [(set GPR:$dst, (zextloadi8 addrmodepc:$addr))]>; -def PICLDH : AXI3<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), +def PICLDH : AXI3ldh<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tldr${p}h $dst, $addr", [(set GPR:$dst, (extloadi16 addrmodepc:$addr))]>; -def PICLDB : AXI2<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), +def PICLDB : AXI2ldb<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tldr${p}b $dst, $addr", [(set GPR:$dst, (extloadi8 addrmodepc:$addr))]>; -def PICLDSH : AXI3<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), +def PICLDSH : AXI3ldsh<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tldr${p}sh $dst, $addr", [(set GPR:$dst, (sextloadi16 addrmodepc:$addr))]>; -def PICLDSB : AXI3<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), +def PICLDSB : AXI3ldsb<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tldr${p}sb $dst, $addr", [(set GPR:$dst, (sextloadi8 addrmodepc:$addr))]>; } let AddedComplexity = 10 in { -def PICSTR : AXI2<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p), +def PICSTR : AXI2stw<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tstr$p $src, $addr", [(store GPR:$src, addrmodepc:$addr)]>; -def PICSTRH : AXI3<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p), +def PICSTRH : AXI3sth<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tstr${p}h $src, $addr", [(truncstorei16 GPR:$src, addrmodepc:$addr)]>; -def PICSTRB : AXI2<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p), +def PICSTRB : AXI2stb<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tstr${p}b $src, $addr", [(truncstorei8 GPR:$src, addrmodepc:$addr)]>; }