<html><head><base href="x-msg://1139/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 14, 2010, at 8:20 AM, zr wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">Hi,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">I noticed a bunch of psuedo instructions used for creation of constants without generating loads. e.g. pxor xmm0, xmm0</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 12pt; ">Here is an example of what i am </span></font><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">referring</font><font class="Apple-style-span" face="'times new
 roman', 'new york', times, serif" size="4"><span class="Apple-style-span" style="font-size: 12pt; "> to snipped from X86InstrSSE.td:</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: black; font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">def FsFLD0SS : I<0xEF, MRMInitReg, (outs FR32:$dst), (ins), "",</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">                 [(set FR32:$dst, fp32imm0)]>,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">                 Requires<[HasSSE1]>, TB, OpSize;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">My question is why was there a need to define such a pseudo instruction?</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Wouldn't it be cleaner to use a def: Pat<> which selects: </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">pxor $dst, $dst </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">from:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">[(set FR32:$dst, fp32imm0)] ?</div></div></div></div></span></blockquote><br></div><div>Yes, that would be cleaner, except that "xor" and "clear register" have different side effects from the code generator perspective.  "Clear register" has no input register operand, but "xor" does.  This difference is eliminated after codegen is done and the pseudo instruction is lowered by MCInstLowering.</div><div><br></div><div>-Chris </div><br></body></html>