As far as I can tell, it's translated unconditionally to 'frc' instruction for both sm4 and older. For this specific constant, it does match "x - floor(x)", giving 0.75, with floor begin -3.0. But such optimization on constant input should be done somewhere else, or do you mean we should have a test now anyway?
Right, translating this to "frc" makes sense. We're also implicitly testing the GLSL and SPIR-V backends with .shader_test tests though, and I don't think we have existing coverage for frc/frac() there. Optimising constant inputs would happen in hlsl_fold_constant_exprs(). I think handling HLSL_OP1_FRACT should be fairly straightforward, but I don't think it's a requirement for this MR. I do think that as a matter of principle having test coverage for the different intrinsics we implement is simply a good idea. These tests don't necessarily need to be complicated; see e.g. "sqrt.shader_test" for a straightforward example. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/68#note_21449