summaryrefslogtreecommitdiff
path: root/arch/armv7
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2024-08-22 20:25:30 -0400
committermason <35282038+emesare@users.noreply.github.com>2024-08-27 11:16:59 -0700
commit8b2968d9f947b69e55d477539e54b2659130c524 (patch)
treea3ff88804f63d88293dcf99dd3d490da46536804 /arch/armv7
parent0dc3f33a04b2f3fc746c1cce5f02fd61a7308cb6 (diff)
Lift more variants of VCVT and correct a missed variant case
Diffstat (limited to 'arch/armv7')
-rw-r--r--arch/armv7/thumb2_disasm/il_thumb2.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/armv7/thumb2_disasm/il_thumb2.cpp b/arch/armv7/thumb2_disasm/il_thumb2.cpp
index 110d2511..0609f134 100644
--- a/arch/armv7/thumb2_disasm/il_thumb2.cpp
+++ b/arch/armv7/thumb2_disasm/il_thumb2.cpp
@@ -1490,11 +1490,19 @@ bool GetLowLevelILForNEONInstruction(Architecture* arch, LowLevelILFunction& il,
// TODO: This is not the correct way to get the vcvt format right lol?
if (strcmp(instr->format->operation, "vcvt.u32.f32") == 0 || strcmp(instr->format->operation, "vcvt.s32.f32") == 0)
{
- il.AddInstruction(WriteILOperand(il, instr, 0, il.FloatToInt(GetRegisterSize(instr, 1), ReadILOperand(il, instr, 1))));
+ il.AddInstruction(WriteILOperand(il, instr, 0,
+ il.FloatToInt(GetRegisterSize(instr, 1), ReadILOperand(il, instr, 1))));
}
- else if (strcmp(instr->format->operation, "vcvt.u32.f32") == 0 || strcmp(instr->format->operation, "vcvt.s32.f32") == 0)
+ else if (strcmp(instr->format->operation, "vcvt.f32.u32") == 0 || strcmp(instr->format->operation, "vcvt.f32.s32") == 0)
{
- il.AddInstruction(WriteILOperand(il, instr, 0, il.FloatToInt(GetRegisterSize(instr, 1), ReadILOperand(il, instr, 1))));
+ il.AddInstruction(WriteILOperand(il, instr, 0,
+ il.IntToFloat(GetRegisterSize(instr, 1), ReadILOperand(il, instr, 1))));
+ }
+ else if (strcmp(instr->format->operation, "vcvt.f32") == 0 || instr->format->operandCount == 2)
+ {
+ // TODO: This a vector to float thing.
+ il.AddInstruction(WriteILOperand(il, instr, 0,
+ il.FloatConvert(GetRegisterSize(instr, 1), ReadILOperand(il, instr, 1))));
}
else
{