These instructions take the absolute of two values and perform a FCMGE/FCMGT between them. This patch adds some basic patterns for them.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM for the Vector Change.
Should this also be handled for the scalar equivalent as below
%abs1.i = tail call float @llvm.fabs.f32(float %a) %abs1.i2 = tail call float @llvm.fabs.f32(float %b) %cmp = fcmp oge float %abs1.i, %abs1.i2 %sext = sext i1 %cmp to i32 ret i32 %sext
Comment Actions
Yeah I had seen the scalar instruction. Scalar usually uses fcmp instructions that set flags though, they don't set lanes to all-ones like vector instructions. We could use the scalar vacgt/vacge for the pattern you describe (so long as the result is moved from the vpr to a gpr), but I'm not sure that would come up a lot and should probably at least be handled as a separate patch.