Skip to content

aarch64: implements lifting (intrinsics) for LDXP/STXP #6360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions arch/arm64/arch_arm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,8 @@ class Arm64Architecture : public Architecture
return "__ldxrb";
case ARM64_INTRIN_LDXRH:
return "__ldxrh";
case ARM64_INTRIN_LDXP:
return "__ldxp";
case ARM64_INTRIN_LDAXR:
return "__ldaxr";
case ARM64_INTRIN_LDAXRB:
Expand All @@ -1016,6 +1018,8 @@ class Arm64Architecture : public Architecture
return "__stxrb";
case ARM64_INTRIN_STXRH:
return "__stxrh";
case ARM64_INTRIN_STXP:
return "__stxp";
case ARM64_INTRIN_STLXR:
return "__stlxr";
case ARM64_INTRIN_STLXRB:
Expand Down
6 changes: 6 additions & 0 deletions arch/arm64/il.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2016,6 +2016,9 @@ bool GetLowLevelILForInstruction(
case ARM64_LDXRH:
il.AddInstruction(il.Intrinsic({ RegisterOrFlag::Register(REG_O(operand1)) }, ARM64_INTRIN_LDXRH, { ILREG_O(operand2) }));
// We don't have a way to specify intrinsic register size, so we explicitly embed the size in the intrinsic name.
case ARM64_LDXP:
il.AddInstruction(il.Intrinsic({ RegisterOrFlag::Register(REG_O(operand1)), RegisterOrFlag::Register(REG_O(operand2)) }, ARM64_INTRIN_LDXP, { ILREG_O(operand3) }));
break;
case ARM64_LDAXR:
il.AddInstruction(il.Intrinsic({ RegisterOrFlag::Register(REG_O(operand1)) }, ARM64_INTRIN_LDAXR, { ILREG_O(operand2) }));
break;
Expand All @@ -2034,6 +2037,9 @@ bool GetLowLevelILForInstruction(
case ARM64_STXRH:
il.AddInstruction(il.Intrinsic({ RegisterOrFlag::Register(REG_O(operand1)) }, ARM64_INTRIN_STXRH, { ILREG_O(operand2), ILREG_O(operand3) }));
break;
case ARM64_STXP:
il.AddInstruction(il.Intrinsic({ RegisterOrFlag::Register(REG_O(operand1)) }, ARM64_INTRIN_STXP, { ILREG_O(operand2), ILREG_O(operand3), ILREG_O(operand4) }));
break;
case ARM64_STLXR:
il.AddInstruction(il.Intrinsic({ RegisterOrFlag::Register(REG_O(operand1)) }, ARM64_INTRIN_STLXR, { ILREG_O(operand2), ILREG_O(operand3) }));
break;
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/il.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ enum Arm64Intrinsic : uint32_t
ARM64_INTRIN_LDXR,
ARM64_INTRIN_LDXRB,
ARM64_INTRIN_LDXRH,
ARM64_INTRIN_LDXP,
ARM64_INTRIN_LDAXR,
ARM64_INTRIN_LDAXRB,
ARM64_INTRIN_LDAXRH,
ARM64_INTRIN_STXR,
ARM64_INTRIN_STXRB,
ARM64_INTRIN_STXRH,
ARM64_INTRIN_STXP,
ARM64_INTRIN_STLXR,
ARM64_INTRIN_STLXRB,
ARM64_INTRIN_STLXRH,
Expand Down