<div dir="ltr"><div>FWIW, I think UCMP is a misleading name. Whatever the name will be, it should be prefixed with "I" or "U", because it's not a floating-point opcode. How about UCND? :D<br><br></div>
Marek<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 4, 2013 at 6:23 PM, Jose Fonseca <span dir="ltr"><<a href="mailto:jfonseca@vmware.com" target="_blank">jfonseca@vmware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There might be some value in renaming UCMP to be MOVC though. I think everybody here can agree that UCMP, though semantically correct, is misleading.<br>
<span class="HOEnZb"><font color="#888888"><br>
Jose<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
----- Original Message -----<br>
> Hah, yea, I'm sorry, that's a good point. So movc is a bitcast to unsigned<br>
> followed by ucmp. Alright, I'm withdrawing the patch.<br>
><br>
> z<br>
><br>
> ----- Original Message -----<br>
> ><br>
> ><br>
> > ----- Original Message -----<br>
> > > > > Erm, unsigned < 0 doesn't make sense.<br>
> > > ><br>
> > > > Ah indeed!<br>
> > > ><br>
> > > > > Definitely what the description says:<br>
> > > > > static void<br>
> > > > > micro_ucmp(union tgsi_exec_channel *dst,<br>
> > > > > const union tgsi_exec_channel *src0,<br>
> > > > > const union tgsi_exec_channel *src1,<br>
> > > > > const union tgsi_exec_channel *src2)<br>
> > > > > {<br>
> > > > > dst->u[0] = src0->u[0] ? src1->u[0] : src2->u[0];<br>
> > > > > dst->u[1] = src0->u[1] ? src1->u[1] : src2->u[1];<br>
> > > > > dst->u[2] = src0->u[2] ? src1->u[2] : src2->u[2];<br>
> > > > > dst->u[3] = src0->u[3] ? src1->u[3] : src2->u[3];<br>
> > > > > }<br>
> > > > ><br>
> > > > > or<br>
> > > > ><br>
> > > > > case TGSI_OPCODE_UCMP:<br>
> > > > > case TGSI_OPCODE_CMP:<br>
> > > > > FOR_EACH_DST_ENABLED_CHANNEL(0, c, tgsi) {<br>
> > > > > src0 = fetchSrc(0, c);<br>
> > > > > src1 = fetchSrc(1, c);<br>
> > > > > src2 = fetchSrc(2, c);<br>
> > > > > if (src1 == src2)<br>
> > > > > mkMov(dst0[c], src1);<br>
> > > > > else<br>
> > > > > mkCmp(OP_SLCT, (srcTy == TYPE_F32) ? CC_LT(less than 0) :<br>
> > > > > CC_NE(not equal 0),<br>
> > > > > srcTy, dst0[c], src1, src2, src0);<br>
> > > > > }<br>
> > > > ><br>
> > > ><br>
> > > > But odd enough, the implementations I happend to look at seemed to do<br>
> > > > "foo<br>
> > > > >=<br>
> > > > 0":<br>
> > ><br>
> > > Yea, like I mentioned it's pretty broken. Sometimes it's implemented as<br>
> > > UCMP,<br>
> > > sometimes it's implemented as MOVC.<br>
> > > It seems to be used only as MOVC.<br>
> > > It feels silly writing this, but we should probably make UCMP act like<br>
> > > UCMP<br>
> > > and add MOVC and use it when we need a MOVC.<br>
> ><br>
> > Zack, I believe Christoph has a point when he says that UCMP is<br>
> > semantically<br>
> > the same as MOVC.<br>
> ><br>
> > Because for unsigned integers, "foo > 0" is the same as "foo != 0",<br>
> > therefore<br>
> > having UCMP defined as<br>
> ><br>
> > dst = src0 > 0 ? src1 : src2<br>
> ><br>
> > or a MOVC as<br>
> ><br>
> > dst = src0 != 0 ? src1 : src2<br>
> ><br>
> > is pretty much the same.<br>
> ><br>
> > Jose<br>
> ><br>
> ><br>
><br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div>