<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 25, 2013, at 8:00 AM, Dan Gohman <<a href="mailto:dan433584@gmail.com">dan433584@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">On Wed, Apr 24, 2013 at 11:33 PM, Owen Anderson <span dir="ltr"><<a href="mailto:resistor@mac.com" target="_blank">resistor@mac.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Dan,<br></blockquote><div><br></div><div>Hi Owen,</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Others have weighed in on the merits of IR vs MI legalization, I thought I'd chip in on a different area:<br>
<br>
+    /// Legal roughly means there's a physical register class on the target<br>
+    /// machine for a type, and there's a reasonable set of instructions<br>
+    /// which operate on registers of this class and interpret their contents<br>
+    /// as instances of the type. For convenience, Legal is also used for<br>
+    /// types which are not legalized by this pass (vectors, floats, etc.)<br>
+    Legal,<br>
<br>
I don't think this is the right definition of a legal type.  I know that that's how SelectionDAG currently defines it, and I think that definition is behind a lot of the difficulty in retargeting LLVM to something that doesn't look like the intersection of X86 and ARM.<br>



</blockquote><div><br></div><div>Do you have a particular target in mind that we could discuss? Not all variances from the intersection of x86 and ARM are of the same nature; it's hard to talk in full generality here.</div></div></div></div></blockquote><div><br></div><div>I have a target for which v4i8 is legal. I can load it, store it, copy it, insert/extract elements, shuffle it.  But I can't add it, subtract it, multiply it, etc.  It can also load, store, and copy v16f32, but again can't operate on it.</div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">


<div>I don't see why load and store are special at this level though. Or insert/extract element?</div></div></div></div></blockquote><br></div><div>I'm open to suggestions on this, but the point was to preserve <i>some</i> functionality for type legalization, rather than going back to the old-style of having only a combined type+op legalizer.  The concept was to prune back the functionality of type legalization to only dispensing with types for which the really is<i> </i>not even minimal hardware support.</div><div><br></div><div>--Owen</div></body></html>