Skip to content

Commit

Permalink
IDA Pro: Support AVX-512 opmask registers
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 600398932
Change-Id: Idfbc110b55c447215df207e5d2f559db3c9b0942
  • Loading branch information
cblichmann authored and copybara-github committed Jan 22, 2024
1 parent 11e8e69 commit 48771c7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ida/metapc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ std::string GetExtendedRegisterName(const op_t& operand) {
return absl::StrCat("ymm", operand.reg);
case o_zmmreg: // AVX-512 register
return absl::StrCat("zmm", operand.reg);
case o_kreg: // AVX-512 opmask register
return absl::StrCat("k", operand.reg);
case o_fpreg: // Floating point register
return absl::StrCat("st(", operand.reg, ")");
default:
Expand Down Expand Up @@ -131,8 +133,9 @@ std::string GetInstanceName(Address address) { return GetName(address, false); }
void HandlePhraseExpression(Expressions* expressions, FlowGraph* flow_graph,
const insn_t& instruction, const op_t& operand,
uint8_t operand_num) {
std::string base, index;
if (ad16(instruction)) { // https://zynamics.fogbugz.com/default.asp?2792
std::string base;
std::string index;
if (ad16(instruction)) {
switch (operand.phrase) {
case 0:
base = "bx";
Expand Down Expand Up @@ -389,6 +392,7 @@ Operands ParseOperandsIdaMetaPc(const insn_t& instruction,
case o_xmmreg: // SSE register
case o_ymmreg: // AVX register
case o_zmmreg: // AVX-512 register
case o_kreg: // AVX-512 opmask register
case o_fpreg: // Floating point register
if (operand_size != 0) {
expression =
Expand Down Expand Up @@ -482,7 +486,7 @@ Instruction ParseInstructionIdaMetaPc(const insn_t& instruction,
if (!IsCode(instruction.ea)) {
return Instruction(instruction.ea);
}
std::string mnemonic(GetMnemonic(instruction.ea));
std::string mnemonic = GetMnemonic(instruction.ea);
if (mnemonic.empty()) {
return Instruction(instruction.ea);
}
Expand Down

0 comments on commit 48771c7

Please sign in to comment.