From 8b2968d9f947b69e55d477539e54b2659130c524 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Thu, 22 Aug 2024 20:25:30 -0400 Subject: Lift more variants of VCVT and correct a missed variant case --- arch/armv7/thumb2_disasm/il_thumb2.cpp | 14 +++++++++++--- 1 file 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 { -- cgit v1.3.1