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

consider cpuid features when deciding invalid instrs #431

Open
derekbruening opened this issue Nov 28, 2014 · 2 comments
Open

consider cpuid features when deciding invalid instrs #431

derekbruening opened this issue Nov 28, 2014 · 2 comments

Comments

@derekbruening
Copy link
Contributor

derekbruening commented Nov 28, 2014

From bruen...@google.com on April 11, 2011 10:37:32

currently the DR encoder will not consider a new opcode as invalid
when running on an older processor that does not have that feature.
this isn't a serious problem for DR itself since the right thing
will happen when treating an invalid instr as valid: it's the other way
around that causes often-fatal problems.
but for DR as a disassembly library and for precision it would be nice
to consider the cpuid features of the current processor. the feature
set to assume may have to become a global setting when decoding statically.

Original issue: http://code.google.com/p/dynamorio/issues/detail?id=431

@fhahn
Copy link
Contributor

fhahn commented Apr 25, 2018

We could provide an API for clients to check if a given ISA version supports a given encoding. For example, half precision floating point arithmetic was only added in Armv8.2 and those instructions are not supported by earlier architecture versions.

I am not entirely sure how such an API should look like so it is flexible enough for a wide range of clients but can also be implemented efficiently.

@derekbruening
Copy link
Contributor Author

Trying to clarify the opening comment above: for standalone decoding, we want a default of allowing all instructions, but with options to specify the feature set or query whether an instruction lies in it.

Xref #5725 where inconsistent defaults are leading to flaky tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants