[PATCH] D70101: [X86] Fix the implementation of __readcr3/__writecr3 to work in 64-bit mode

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 11 15:32:40 PST 2019


rnk added a comment.

What do you think of using `__INTPTR_TYPE__` for this instead? If that doesn't work, we could define and undefine our own macro to use as a typedef. The resulting code should be clean enough that we can generalize it to `__readcr0` etc.

It looks like `long` is the correct return type for 32-bit:
https://gcc.godbolt.org/z/6NzZWz
I'm not sure what the best device to figure out `__writecr3` would be.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70101/new/

https://reviews.llvm.org/D70101





More information about the cfe-commits mailing list