<html><head></head><body bgcolor="#FFFFFF"><div>Ok.  Load store targets can still fold memops into copies though...<br><br><div>-Chris</div></div><div><br>On Jul 5, 2012, at 10:17 PM, Jakob Stoklund Olesen <<a href="mailto:stoklund@2pi.dk">stoklund@2pi.dk</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><br><div><div>On Jul 5, 2012, at 9:50 PM, Chris Lattner <<a href="mailto:clattner@apple.com">clattner@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><blockquote type="cite" style="font-family: monospace; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">+/// getCMovFromCond - Return a cmov(rr) opcode for the given condition and<br>+/// register size in bytes.<br>+static unsigned getCMovFromCond(X86::CondCode CC, unsigned RegBytes) {<br>+  static const unsigned Opc[16][3] = {<br>+    { X86::CMOVA16rr,  X86::CMOVA32rr,  X86::CMOVA64rr  },<br></blockquote><br style="font-family: monospace; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span style="font-family: monospace; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; ">How feasible would it be to autogenerate these tables from tablegen?</span></blockquote><div><br></div><div>Tricky. Condition code handling has a lot of differences between targets, and often for good reasons. ARM, for example, puts condition codes in an immediate operand instead of the opcode. That eliminates the need for these tables.</div><div><br></div><div>There isn't a lot of common ground that TableGen could exploit.</div><br><blockquote type="cite"><span style="font-family: monospace; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; ">  These and the load folding tables should really be able to be mechanically produced, meaning that each target doesn't have to implement (and maintain) the same stuff.</span><br style="font-family: monospace; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "></blockquote></div><br><div>Actually, X86 is the only target that needs load folding tables. Most other architectures are load/store.</div><div><br></div><div>It would still be nice to have these tables emitted by TableGen, though. Even with an X86-specific backend.</div><div><br></div><div>/jakob</div><div><br></div></div></blockquote></body></html>