-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Update documentation on x86 constraint codes #68830
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
Conversation
@llvm/pr-subscribers-backend-x86 @llvm/pr-subscribers-llvm-ir Author: None (bjacob) ChangesThis updates the documentation on these inline asm constraint codes to match reality. Context: #68818 (comment) . @parvizmp Note: dropping also the Full diff: https://github.com/llvm/llvm-project/pull/68830.diff 1 Files Affected:
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 1883e9f6290b151..0e5621f9b650a3b 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -5282,7 +5282,6 @@ X86:
- ``O``: An immediate integer between 0 and 127.
- ``e``: An immediate 32-bit signed integer.
- ``Z``: An immediate 32-bit unsigned integer.
-- ``o``, ``v``: Treated the same as ``m``, at the moment.
- ``q``: An 8, 16, 32, or 64-bit register which can be accessed as an 8-bit
``l`` integer register. On X86-32, this is the ``a``, ``b``, ``c``, and ``d``
registers, and on X86-64, it is all of the integer registers.
@@ -5293,10 +5292,13 @@ X86:
existed since i386, and can be accessed without the REX prefix.
- ``f``: A 32, 64, or 80-bit '387 FPU stack pseudo-register.
- ``y``: A 64-bit MMX register, if MMX is enabled.
-- ``x``: If SSE is enabled: a 32 or 64-bit scalar operand, or 128-bit vector
+- ``v``: If SSE is enabled: a 32 or 64-bit scalar operand, or 128-bit vector
operand in a SSE register. If AVX is also enabled, can also be a 256-bit
vector operand in an AVX register. If AVX-512 is also enabled, can also be a
- 512-bit vector operand in an AVX512 register, Otherwise, an error.
+ 512-bit vector operand in an AVX512 register. Otherwise, an error.
+- ``x``: The same as ``v``, except that when AVX-512 is enabled, the ``x`` code
+ only allocates into the first 16 AVX-512 registers, while the ``v`` code
+ allocates into any of the 32 AVX-512 registers.
- ``Y``: The same as ``x``, if *SSE2* is enabled, otherwise an error.
- ``A``: Special case: allocates EAX first, then EDX, for a single operand (in
32-bit mode, a 64-bit integer operand will get split into two registers). It
|
I'm not an expert here, this needs to be checked for correctness. @qcolombet can you think of an appropriate reviewer? |
Tentatively assigning this to @nickdesaulniers. |
Oh hi @nickdesaulniers (we used to be colleagues at Mozilla)! |
ping :-) |
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.
LGTM.
Hi! Sorry for being late here. Curiously, https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html doesn't make such distinctions about |
This updates the documentation on these inline asm constraint codes to match reality. Context: #68818 (comment) . @parvizmp
Note: dropping also the
'o'
from the docs because I can't find any mention of it in X86ISelLowering.cpp.