diff options
Diffstat (limited to 'arch/x86/arch_x86.cpp')
| -rw-r--r-- | arch/x86/arch_x86.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/x86/arch_x86.cpp b/arch/x86/arch_x86.cpp index aeeed4e7..83a476bf 100644 --- a/arch/x86/arch_x86.cpp +++ b/arch/x86/arch_x86.cpp @@ -3827,6 +3827,23 @@ public: } return result; } + + bool IsReturnTypeRegisterCompatible(BinaryView*, Type* type) override + { + if (!type) + return false; + if (type->IsFloat()) + return true; + if (type->GetWidth() == 0 || type->GetWidth() == 1 || type->GetWidth() == 2 || type->GetWidth() == 4 + || type->GetWidth() == 8) + return true; + return false; + } + + std::optional<Variable> GetReturnedIndirectReturnValuePointer() override + { + return Variable::Register(XED_REG_EAX); + } }; @@ -4060,6 +4077,36 @@ public: { return true; } + + bool IsReturnTypeRegisterCompatible(BinaryView*, Type* type) override + { + if (!type) + return false; + if (type->IsFloat()) + return true; + return type->GetWidth() == 0 || type->GetWidth() == 1 || type->GetWidth() == 2 || type->GetWidth() == 4 + || type->GetWidth() == 8; + } + + std::optional<Variable> GetReturnedIndirectReturnValuePointer() override + { + return Variable::Register(XED_REG_RAX); + } + + bool IsArgumentTypeRegisterCompatible(BinaryView*, Type* type) override + { + if (!type) + return false; + if (type->IsFloat()) + return true; + return type->GetWidth() == 0 || type->GetWidth() == 1 || type->GetWidth() == 2 || type->GetWidth() == 4 + || type->GetWidth() == 8; + } + + bool IsNonRegisterArgumentIndirect(BinaryView*, Type*) override + { + return true; + } }; |
