By: Patrick Chase (patrickjchase.delete@this.gmai.com), July 7, 2015 2:32 pm
Room: Moderated Discussions
Maynard Handley (name99.delete@this.name99.org) on July 7, 2015 12:00 pm wrote:
> Maybe the problem is when I say cmov/csel I am thinking of the (IMHO) obvious use cases.
> max/min, abs, sgn, and the sorts of very similar functions I constantly dealt with when
> writing codecs (eg parse one bit then, if (bit){motionVector=-motionVector})
> All of these strike me as PRECISELY the point of cmov/csel.
As I think you're aware we have very similar backgrounds in that respect (codecs etc), so I'm aware of those cases. I ignored them for a few reasons:
1. I question whether they're common/important enough to drive the design of a general-purpose machine.
2. They're often predictable in my experience. For example min/max are typically used for saturation, and in most systems that's a relatively rare occurrence.
3. In many instances those can be handled without either a branch or predication, depending on the ISA. Twos-complement abs is an obvious example.
> Perhaps it's my experience in this field where one CONSTANTLY has these sorts of one
> instruction branch-overs --- for clamping values, for non-linear edge smoothing, etc
> --- that makes me appreciate their value;
As someone who comes from a similar background I believe that doing things like codecs tends to make one OVER-appreciate their value.
> Maybe the problem is when I say cmov/csel I am thinking of the (IMHO) obvious use cases.
> max/min, abs, sgn, and the sorts of very similar functions I constantly dealt with when
> writing codecs (eg parse one bit then, if (bit){motionVector=-motionVector})
> All of these strike me as PRECISELY the point of cmov/csel.
As I think you're aware we have very similar backgrounds in that respect (codecs etc), so I'm aware of those cases. I ignored them for a few reasons:
1. I question whether they're common/important enough to drive the design of a general-purpose machine.
2. They're often predictable in my experience. For example min/max are typically used for saturation, and in most systems that's a relatively rare occurrence.
3. In many instances those can be handled without either a branch or predication, depending on the ISA. Twos-complement abs is an obvious example.
> Perhaps it's my experience in this field where one CONSTANTLY has these sorts of one
> instruction branch-overs --- for clamping values, for non-linear edge smoothing, etc
> --- that makes me appreciate their value;
As someone who comes from a similar background I believe that doing things like codecs tends to make one OVER-appreciate their value.