| 1969 | } |
| 1970 | |
| 1971 | String BeMCContext::ToString(const BeMCOperand& operand) |
| 1972 | { |
| 1973 | if (operand.mKind == BeMCOperandKind_NativeReg) |
| 1974 | { |
| 1975 | return String("%") + X64CPURegisters::GetRegisterName((int)operand.mReg); |
| 1976 | } |
| 1977 | |
| 1978 | if (operand.IsVRegAny()) |
| 1979 | { |
| 1980 | auto vregInfo = GetVRegInfo(operand); |
| 1981 | |
| 1982 | String str; |
| 1983 | mModule->ToString(str, GetType(operand)); |
| 1984 | str += " "; |
| 1985 | |
| 1986 | if (operand.IsVRegAny()) |
| 1987 | { |
| 1988 | auto vregInfo = GetVRegInfo(operand); |
| 1989 | if (operand.mKind == BeMCOperandKind_VRegAddr) |
| 1990 | str += "&"; |
| 1991 | if (operand.mKind == BeMCOperandKind_VRegLoad) |
| 1992 | str += "*"; |
| 1993 | if (vregInfo->mDbgVariable != NULL) |
| 1994 | str += "#" + vregInfo->mDbgVariable->mName + StrFormat("/%d", operand.mVRegIdx); |
| 1995 | else |
| 1996 | str += StrFormat("%%vreg%d", operand.mVRegIdx); |
| 1997 | } |
| 1998 | |
| 1999 | if (vregInfo->mReg != X64Reg_None) |
| 2000 | { |
| 2001 | str += "<"; |
| 2002 | str += X64CPURegisters::GetRegisterName((int)vregInfo->mReg); |
| 2003 | str += ">"; |
| 2004 | } |
| 2005 | else if (vregInfo->mForceReg) |
| 2006 | { |
| 2007 | str += "<reg>"; |
| 2008 | } |
| 2009 | |
| 2010 | if (vregInfo->mDisableR11) |
| 2011 | { |
| 2012 | str += "<NoR11>"; |
| 2013 | } |
| 2014 | if (vregInfo->mDisableR12) |
| 2015 | { |
| 2016 | str += "<NoR12>"; |
| 2017 | } |
| 2018 | if (vregInfo->mDisableR13) |
| 2019 | { |
| 2020 | str += "<NoR13>"; |
| 2021 | } |
| 2022 | if (vregInfo->mDisableRAX) |
| 2023 | { |
| 2024 | str += "<NoRAX>"; |
| 2025 | } |
| 2026 | if (vregInfo->mDisableRDX) |
| 2027 | { |
| 2028 | str += "<NoRDX>"; |