I’m reading a variable from global mem, and multiplying it with itself to raise it one power. I’d like to keep the signedness of the 2nd power number the same as the original number - Can I copy the sign bit of the input number somehow and apply it to the new number? This is what I’m currently doing:
numPowSum += tmpNum * tmpNum * ((tmpNum < 0) ? -1 : 1);
I’d like to see if there’s any benefit to getting rid of the branching - A hunch says that it might be. Right now I’m doing a check + multiplication, a blind copy should be simpler. Might take more registers though. Any thoughts?