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
New bmi instructions #76
Changes from all commits
a675eb3
06b6fa7
2ad0a9a
0ac2113
2a1cab8
f7b20e1
8c53e18
0156c5f
dc3eb3e
852ea5e
21dbccd
0292e13
b109b0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -343,6 +343,10 @@ data Instr | |
| BSF Format Operand Reg -- bit scan forward | ||
| BSR Format Operand Reg -- bit scan reverse | ||
|
||
-- bit manipulation instructions | ||
| PDEP Format Operand Reg -- [BMI2] deposit bits to the specified mask | ||
| PEXT Format Operand Reg -- [BMI2] extract bits from the specified mask | ||
|
||
-- prefetch | ||
| PREFETCH PrefetchVariant Format Operand -- prefetch Variant, addr size, address to prefetch | ||
-- variant can be NTA, Lvl0, Lvl1, or Lvl2 | ||
|
@@ -459,6 +463,8 @@ x86_regUsageOfInstr platform instr | |
DELTA _ -> noUsage | ||
|
||
POPCNT _ src dst -> mkRU (use_R src []) [dst] | ||
PDEP _ src dst -> mkRU (use_R src []) [dst] | ||
PEXT _ src dst -> mkRU (use_R src []) [dst] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure the above two lines are wrong. I wrote it that way just to get it to compile. The I'm looking at what options I have:
None of them really work for me. The closest match is the 3 operand one:
I believe what I need is: first operand Read; second Read; third Write There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In that case perhaps what you want is, PDEP a b c -> mkRU (use_R a $ use_R b) (def_W c) Does this look better? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like I was just missing a
Thanks for the hint! |
||
BSF _ src dst -> mkRU (use_R src []) [dst] | ||
BSR _ src dst -> mkRU (use_R src []) [dst] | ||
|
||
|
@@ -638,6 +644,8 @@ x86_patchRegsOfInstr instr env | |
CLTD _ -> instr | ||
|
||
POPCNT fmt src dst -> POPCNT fmt (patchOp src) (env dst) | ||
PDEP fmt src dst -> PDEP fmt (patchOp src) (env dst) | ||
PEXT fmt src dst -> PEXT fmt (patchOp src) (env dst) | ||
BSF fmt src dst -> BSF fmt (patchOp src) (env dst) | ||
BSR fmt src dst -> BSR fmt (patchOp src) (env dst) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I proceeded to add the above, because it seemed like it would fix my compile errors. It's not clear to me this is the correct approach, but put it here to ask if it makes sense.
If it is the correct thing to do, I could start working on the
error "TODO: ..."
bits, otherwise I'll revert.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would comment but unfortunately I can't view the patch. Have you force pushed by any chance?
Also, we generally use
panic
noterror
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I have forced pushed. Did that break things for you? Should I avoid doing that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that GitHub's pull request mechanism doesn't allow you to view old commits after a force-push. Try clicking the "View changes" button above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I see it is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the change can only be seen from the "Files Changed" tab.