Skip to content

Commit a9ef880

Browse files
committed
Merge remote-tracking branch
'origin/GP-4254_ghidorahrex_PR-6113_marcushall42_xtensa_bany_fix' (Closes NationalSecurityAgency#6113)
2 parents f755681 + d1f017f commit a9ef880

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Ghidra/Processors/Xtensa/data/languages/xtensa.ldefs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
endian="little"
66
size="32"
77
variant="default"
8-
version="4.0"
8+
version="4.1"
99
slafile="xtensa_le.sla"
1010
processorspec="xtensa.pspec"
1111
manualindexfile="../manuals/xtensa.idx"
@@ -19,7 +19,7 @@
1919
endian="big"
2020
size="32"
2121
variant="default"
22-
version="4.0"
22+
version="4.1"
2323
slafile="xtensa_be.sla"
2424
processorspec="xtensa.pspec"
2525
manualindexfile="../manuals/xtensa.idx"

Ghidra/Processors/Xtensa/data/languages/xtensaInstructions.sinc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
# BANY - Branch if Any Bit Set, pg. 265.
123123
:bany srel_16_23, as, at, is srel_16_23 & ar = 0b1000 & as & at & op0 = 0b0111 {
124124
local test:4 = as & at;
125-
if (test == 0) goto srel_16_23;
125+
if (test != 0) goto srel_16_23;
126126
}
127127

128128
macro extract_bit(bit, result) {
@@ -399,7 +399,7 @@ macro extract_bit(bit, result) {
399399
local mt:1 = (x s> (-clamp));
400400
local max:4 = (zext(mt) * x) + (zext(!mt) * (-clamp));
401401
mt = (x s< (clamp-1));
402-
local y = (zext(mt) * max) + (zext(!mt) * (clamp-1));
402+
ar = (zext(mt) * max) + (zext(!mt) * (clamp-1));
403403
}
404404

405405
# DHI - Data Cache Hit Invalidate, pg. 313.
@@ -1166,6 +1166,12 @@ rfi_eps: ptr is u4_8_11 [ ptr = $(EPS_BASE) + (4 * u4_8_11); ] { export *[regist
11661166
local tmp:4 = as << shift;
11671167
ar = tmp s>> shift;
11681168
}
1169+
:sext ar, as, 7 is op2 = 0b0010 & op1 = 0b0011 & ar & as & u4_4_7 = 0 & op0 = 0 {
1170+
ar = sext(as:1);
1171+
}
1172+
:sext ar, as, 15 is op2 = 0b0010 & op1 = 0b0011 & ar & as & u4_4_7 = 8 & op0 = 0 {
1173+
ar = sext(as:2);
1174+
}
11691175

11701176
# SICT - Store Instruction Cache Tag, pg. 519.
11711177
:sict at, as is op2 = 0b1111 & op1 = 0b0001 & ar = 0b0001 & as & at & op0 = 0 {

0 commit comments

Comments
 (0)