在我的OpenCL
内核中,我发现:
error += y;
++y;
error += y;
// The following test may be implemented in assembly language in
// most machines by testing the carry flag after adding 'y' to
// the value of 'error' in the previous step, since 'error'
// nominally has a negative value.
if (error >= 0)
{
error -= x;
--x;
error -= x;
}
显然,可以使用一些漂亮的汇编指令轻松优化这些操作。如何优化此代码OpenCL
?