I notice that as soon as i put in the following line in my compute shader code, it slows down. Does anyone have ideas as to why?

Attempt 1:
Code :
float result = float(int(1 | (-1*int(x > threshold))));

Attempt 2:
Code :
float result=float(int(x < threshold) - int(x > threshold));

Both of these return -1 if x (the value being tested) is greater than threshold, 0 if equal, and 1 if x is less than threshold.

threshold is a uniform declared at the beginning of the shader.

Code :
uniform float threshold;
float x;

Note: x is a float read out of a SSBO or array buffer. I just labelled it float x her for brevity.

Much thanks.