Skip to content
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

Add rdtscp to the dmd-style inline assembler. #3895

Merged
merged 1 commit into from
Jan 11, 2022
Merged
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
9 changes: 9 additions & 0 deletions gen/asm-x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ typedef enum {
Op_0,
Op_0_AX,
Op_0_DXAX,
Op_0_DXCXAX,
Op_Loop,
Op_Flags,
Op_F0_ST,
Expand Down Expand Up @@ -650,6 +651,7 @@ static AsmOpInfo asmOpInfo[N_AsmOpInfo] = {
/* Op_0_AX */ {{0, 0, 0}, 0, Clb_SizeAX},
/* Op_0_DXAX */ {{0, 0, 0}, 0, Clb_SizeDXAX}, // but for cwd/cdq -- how
// do know the size..
/* Op_0_DXCXAX*/ {{0, 0, 0}, 0, Clb_SizeDXAX | Clb_CX},
/* Op_Loop */ {{imm, 0, 0}, 0, Clb_CX},
/* Op_Flags */ {{0, 0, 0}, 0, Clb_Flags},
/* Op_F0_ST */ {{0, 0, 0}, 0, Clb_ST},
Expand Down Expand Up @@ -1527,6 +1529,13 @@ static AsmOpEnt opData[] = {
{"rdpmc", Op_0_DXAX},
//{"rdrand", XXXX},
{"rdtsc", Op_0_DXAX},
/*
RDTSCP clobbers EDX:EAX and ECX
From the Intel manual:
EDX:EAX ← TimeStampCounter;
ECX ← IA32_TSC_AUX[31:0];
*/
{"rdtscp", Op_0_DXCXAX},
{"rep", Op_0},
{"repe", Op_0},
{"repne", Op_0},
Expand Down