Skip to content

Commit 4f49338

Browse files
committed
Merge remote-tracking branch
'origin/GP-3787_ghidorahrex_PowerPC_VLE_branch_CR_operand--SQUASHED' into patch (Closes NationalSecurityAgency#5246)
2 parents 45b0d98 + 8371098 commit 4f49338

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

Ghidra/Processors/PowerPC/data/languages/ppc.ldefs

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
endian="big"
211211
size="32"
212212
variant="PowerQUICC-III-e500mc"
213-
version="1.5"
213+
version="1.6"
214214
slafile="ppc_32_be.sla"
215215
processorspec="ppc_32.pspec"
216216
manualindexfile="../manuals/PowerPC.idx"
@@ -225,7 +225,7 @@
225225
endian="little"
226226
size="32"
227227
variant="PowerQUICC-III-e500mc"
228-
version="1.5"
228+
version="1.6"
229229
slafile="ppc_32_le.sla"
230230
processorspec="ppc_32.pspec"
231231
manualindexfile="../manuals/PowerPC.idx"

Ghidra/Processors/PowerPC/data/languages/ppc_vle.sinc

+15-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CC32: "dnz" is BO_VLE=2 {CTR = CTR-1; tmp:1 = (CTR != 0); export tmp; }
2121
CC32: "dz" is BO_VLE=3 {CTR = CTR-1; tmp:1 = (CTR == 0); export tmp; }
2222

2323
addrBD8: reloc is BD8_VLE [ reloc = inst_start + (BD8_VLE << 1);] { export *[ram]:4 reloc; }
24-
addrBD15: reloc is BD15_VLE [ reloc = inst_start + (BD15_VLE << 1);] { export *[ram]:4 reloc; }
24+
addrBD15: reloc is BD15_VLE [ reloc = inst_start + (BD15_VLE << 1);] { export *[ram]:4 reloc; }
2525
addrBD24: reloc is BD24_VLE [ reloc = inst_start + (BD24_VLE << 1);] { export *[ram]:4 reloc; }
2626

2727
d8PlusRaAddress: S8IMM(A) is S8IMM & A {tmp:$(REGISTER_SIZE) = A+S8IMM; export tmp; }
@@ -70,18 +70,29 @@ IMM16B: val is IMM_0_10_VLE & IMM_16_20_VLE [ val = (IMM_16_20_VLE << 11) |
7070
# NOTE: For the conditional branches, the "official" mnemonics have just bc and bcl.
7171
# We use extended mnemonics so the display is understandable without having to cross-
7272
# reference multiple tables.
73-
:e_b^CC32 addrBD15 is $(ISVLE) & OP=30 & XOP_VLE=8 & LK=0 & addrBD15 & CC32 {
73+
:e_b^CC32 BI_CR_VLE, addrBD15 is $(ISVLE) & OP=30 & XOP_VLE=8 & LK=0 & addrBD15 & BIT_L=0 & BI_CR_VLE & CC32 {
7474
if (CC32 == 0) goto inst_next;
7575
goto addrBD15;
7676
}
7777

78-
:e_b^CC32^"l" addrBD15 is $(ISVLE) & OP=30 & XOP_VLE=8 & LK=1 & addrBD15 & CC32 {
78+
:e_b^CC32^"l" BI_CR_VLE, addrBD15 is $(ISVLE) & OP=30 & XOP_VLE=8 & LK=1 & addrBD15 & BIT_L=0 & BI_CR_VLE & CC32 {
7979
if (CC32 == 0) goto inst_next;
8080
LR= inst_next;
8181
call [addrBD15];
8282
}
8383

84-
:se_b^CC16 addrBD8 is $(ISVLE) & OP5_VLE=28 & addrBD8 & CC16 {
84+
:e_b^CC32 addrBD15 is $(ISVLE) & OP=30 & XOP_VLE=8 & LK=0 & addrBD15 & BIT_L=1 & CC32 {
85+
if (CC32 == 0) goto inst_next;
86+
goto addrBD15;
87+
}
88+
89+
:e_b^CC32^"l" addrBD15 is $(ISVLE) & OP=30 & XOP_VLE=8 & LK=1 & addrBD15 & BIT_L=1 & CC32 {
90+
if (CC32 == 0) goto inst_next;
91+
LR= inst_next;
92+
call [addrBD15];
93+
}
94+
95+
:se_b^CC16 cr0, addrBD8 is $(ISVLE) & OP5_VLE=28 & addrBD8 & cr0 & CC16 {
8596
if (CC16 == 0) goto inst_next;
8697
goto addrBD8;
8798
}

0 commit comments

Comments
 (0)