<div dir="ltr">The "main" X86 register classes are pretty much<div><br></div><div>GR8 - 8-bit general purpose registers</div><div>GR16 - 16-bit general purpose registers</div><div>GR32 - 32-bit general purpose registers</div><div>GR64 - 64-bit general purpose registers</div><div>VR64 - mmx registers</div><div>VR128 - xmm0-xmm15 (vex and legacy sse encodable registers)</div><div>VR256 - ymm0-ymm15 (vex encodable registers)</div><div>VR512 - zmm0-zmm31(evex encodable registers)</div><div>VR128X - xmm0-xmm31 (evex encodable)</div><div>VR256X - ymm0-ymm31 (evex encodable)</div><div>FR32 - xmm0-xmm15 used for single precision floating point</div><div>FR32X - xmm0-xmm31 used for single precision floating point with evex encoding</div><div>FR64 - xmm0-xmm15 used for double precision floating point</div><div>FR64X - xmm0-xmm31 used for double precision floating point with evex encoding</div><div>VK* - mask registers</div><div>VK*WM - mask registers excluding k0 which can be used for write masking</div><div>RFP32 - single precision x87 floating point</div><div>RFP64 - double precision x87 floating point</div><div>RFP80 - extended precision x87 floating point</div><div>FR128 - Some 128-bit integer and floating point in xmm registers. Only partially supported since there is no hardware support for those types.</div><div><br></div><div>The following are used for specific instrutions that take certain registers that aren't in the normal classes, but those instructions are never selected and the registers are never allocated. The instructions are only usable through inline assembly.</div><div>DEBUG_REG<br></div><div>SEGMENT_REG<br></div><div>CONTROL_REG<br></div><div>BNDRReg</div><div><br></div><div>The RST class is after the FP stackifier has converted RFP*.</div><div><br></div><div>CCR and FPCCR just contain the integer and floating point flag registers. These aren't used for register allocation. But they are used by name in other places.</div><div><br></div><div>The others that contain subsets of the above exist for specific purposes. The best way to find their purpose if they don't have a comment is to grep for them in the X86 directory. If you have specific questions about any of these I can try to help.</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br><div class="gmail_quote">On Thu, Jul 27, 2017 at 10:47 PM, Arvind via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Hello Matthias,<br><br></div><div class="gmail_extra"><div class="gmail_quote"><span class="">On 28 July 2017 at 04:13, Matthias Braun <span dir="ltr"><<a href="mailto:mbraun@apple.com" target="_blank">mbraun@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">It's not that hard in principle:<br>
- A register class is a set of registers.<br>
- Virtual Registers have a register class assigned.<br>
- If you have register constraints (like x86 8bit operations only work on al,ah,etc.) then you have to create a new register class to express that. (The only exception being limited to a single register, which instead we express by assigning the physreg directly instead of using a vreg).<br>
- Tablegen may create more regsiter classes for register coalescing where we want to accomodate constraints of multiple instructions at the same time.<br>
- All the information is in the .td file; you just have to put some effort into learning tablegen as the information is often expressed by using functions (i.e. the use add/sub/rotate/etc.) instead of just writing a table/list of registers).<br></blockquote><div><br></div></span><div>Thanks a lot for the response! The TableGen language is fairly straightforward(at least commands used in X86 td file). However, some of the comments about the classes didn't fully make sense: I suppose the constraints are probably derived from the X86 assembly language and I should look there? In addition, some classes don't have any comments(eg: GR64_TCW64) and I couldn't find much info elsewhere.<br><br>Also, I don't know how the TableGen'erated classes are derived. Would reading TableGen's code help understand why those were generated and what constraints they encode? Or should I take another approach?<br></div></div></div></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>