Skip to content

Instantly share code, notes, and snippets.

@micahpearlman
Created September 1, 2010 16:31
Show Gist options
  • Save micahpearlman/560961 to your computer and use it in GitHub Desktop.
Save micahpearlman/560961 to your computer and use it in GitHub Desktop.
Predicated execution on the NEON isn't too hard to get around. As in the code i posted you can translate:
if (cond) x = x1
else x = x0
To:
dx = x1 - x0;
x = x0;
x = x + (cond > 0) * dx;
Which is probably 2-3 cycles, the mov and sub can be issued in parallel. The problem is large branches where both paths are long and independent, you'll either have to; calculate both paths, send the flags from NEON to ARM, or calculate the conditions on the ARM. Each of these have positives and negatives. The last is best if you can precalculate the condition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment