Skip to content

Commit a7cc025

Browse files
author
marcus hall
committed
Fix branch sense in "bany" instruction. Add special cases for "sext" of bytes.
1 parent 5b53b35 commit a7cc025

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
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) {
@@ -1166,6 +1166,15 @@ 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+
}
1175+
:sext ar, as, 23 is op2 = 0b0010 & op1 = 0b0011 & ar & as & u4_4_7 = 12 & op0 = 0 {
1176+
ar = sext(as:3);
1177+
}
11691178

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

0 commit comments

Comments
 (0)