Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Christoph Bumiller
On 04.04.2013 03:45, Zack Rusin wrote: It's part of SM4 (http://goo.gl/4IpeK). It's also fairly painful to emulate without branching. Most hardware supports it natively and even llvm has a 'select' opcode which can handle it without too much hassle. diff --git

Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Zack Rusin
On 04.04.2013 03:45, Zack Rusin wrote: It's part of SM4 (http://goo.gl/4IpeK). It's also fairly painful to emulate without branching. Most hardware supports it natively and even llvm has a 'select' opcode which can handle it without too much hassle. diff --git

Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Christoph Bumiller
On 04.04.2013 16:53, Zack Rusin wrote: On 04.04.2013 03:45, Zack Rusin wrote: It's part of SM4 (http://goo.gl/4IpeK). It's also fairly painful to emulate without branching. Most hardware supports it natively and even llvm has a 'select' opcode which can handle it without too much hassle.

Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Christoph Bumiller
On 04.04.2013 17:01, Jose Fonseca wrote: - Original Message - On 04.04.2013 03:45, Zack Rusin wrote: It's part of SM4 (http://goo.gl/4IpeK). It's also fairly painful to emulate without branching. Most hardware supports it natively and even llvm has a 'select' opcode which can handle

Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Jose Fonseca
- Original Message - On 04.04.2013 17:01, Jose Fonseca wrote: - Original Message - On 04.04.2013 03:45, Zack Rusin wrote: It's part of SM4 (http://goo.gl/4IpeK). It's also fairly painful to emulate without branching. Most hardware supports it natively and even llvm

Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Zack Rusin
Erm, unsigned 0 doesn't make sense. Ah indeed! Definitely what the description says: static void micro_ucmp(union tgsi_exec_channel *dst,            const union tgsi_exec_channel *src0,            const union tgsi_exec_channel *src1,            const union tgsi_exec_channel

Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Christoph Bumiller
On 04.04.2013 17:23, Jose Fonseca wrote: - Original Message - On 04.04.2013 17:01, Jose Fonseca wrote: - Original Message - On 04.04.2013 03:45, Zack Rusin wrote: It's part of SM4 (http://goo.gl/4IpeK). It's also fairly painful to emulate without branching. Most hardware

Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Jose Fonseca
- Original Message - Erm, unsigned 0 doesn't make sense. Ah indeed! Definitely what the description says: static void micro_ucmp(union tgsi_exec_channel *dst,            const union tgsi_exec_channel *src0,            const union tgsi_exec_channel *src1,    

Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Zack Rusin
Hah, yea, I'm sorry, that's a good point. So movc is a bitcast to unsigned followed by ucmp. Alright, I'm withdrawing the patch. z - Original Message - - Original Message - Erm, unsigned 0 doesn't make sense. Ah indeed! Definitely what the description

Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Jose Fonseca
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. Jose - Original Message - Hah, yea, I'm sorry, that's a good point. So movc is a bitcast to unsigned followed by ucmp. Alright, I'm

Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Roland Scheidegger
FWIW it looks like we could use that opcode a bit more in glsl to tgsi translation. There's one use of it in st_glsl_to_tgsi.cpp (though coupled with a USNE which I'm not sure is even necessary) but another place states that If TGSI had a UCMP instruction or similar, this extra instruction would

Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Marek Olšák
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 Marek On Thu, Apr 4, 2013 at 6:23 PM, Jose Fonseca jfons...@vmware.com wrote: There might be some value in renaming UCMP to be

Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Roland Scheidegger
Well if the condition is just any bit set then it doesn't matter if the input is a float or int or whatever (of course, for floats, that definition is different than != zero, as it doesn't hold for negative zero). That would be the same as for instance the bitwise instructions which also don't

Re: [Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-04 Thread Marek Olšák
I see. Fair point. Marek On Thu, Apr 4, 2013 at 7:32 PM, Roland Scheidegger srol...@vmware.comwrote: Well if the condition is just any bit set then it doesn't matter if the input is a float or int or whatever (of course, for floats, that definition is different than != zero, as it doesn't

[Mesa-dev] [PATCH] tgsi: Add a conditional move inststruction

2013-04-03 Thread Zack Rusin
It's part of SM4 (http://goo.gl/4IpeK). It's also fairly painful to emulate without branching. Most hardware supports it natively and even llvm has a 'select' opcode which can handle it without too much hassle. Signed-off-by: Zack Rusin za...@vmware.com ---