James-Jones/HLSLCrossCompiler — pull request #33 by MrShoor (2014-09-30 08:08:57+00:00)
Title: Fix MOVC translation with swizzle

Fix incorrect swizzling for MOVC instruction:

Broken sample:

struct PS_Input {
float4 Pos: SV_Position;
};
struct PS_Output {
float4 Color : SV_Target0;
};
PS_Output PS(PS_Input In) {
PS_Output Out;
Out.Color.xw = 0.0;
Out.Color.yz = fmod(In.Pos.xy, 40.0)/40.0;
return Out;
}

Incorrect result for MOVC:
Output0.y = (floatBitsToInt(Temp[0]).z != 0) ? Temp[0].x : (-Temp[0].x);
Output0.z = (floatBitsToInt(Temp[0]).z != 0) ? Temp[0].x : (-Temp[0].x);

Correct result:
Output0.y = (floatBitsToInt(Temp[0]).z != 0) ? Temp[0].x : (-Temp[0].x);
Output0.z = (floatBitsToInt(Temp[0]).w != 0) ? Temp[0].y : (-Temp[0].y);