public static Operand[] GetHalfUnpacked(EmitterContext context, Operand src, HalfSwizzle swizzle) { switch (swizzle) { case HalfSwizzle.F16: return new Operand[] { context.UnpackHalf2x16Low (src), context.UnpackHalf2x16High(src) }; case HalfSwizzle.F32: return new Operand[] { src, src }; case HalfSwizzle.H0H0: return new Operand[] { context.UnpackHalf2x16Low(src), context.UnpackHalf2x16Low(src) }; case HalfSwizzle.H1H1: return new Operand[] { context.UnpackHalf2x16High(src), context.UnpackHalf2x16High(src) }; } throw new ArgumentException($"Invalid swizzle \"{swizzle}\"."); }
public static Operand[] GetHalfSrc( EmitterContext context, HalfSwizzle swizzle, int ra, bool negate, bool absolute) { Operand[] operands = GetHalfUnpacked(context, GetSrcReg(context, ra), swizzle); return FPAbsNeg(context, operands, absolute, negate); }
public static Operand[] GetHalfSrc( EmitterContext context, HalfSwizzle swizzle, int cbufSlot, int cbufOffset, bool negate, bool absolute) { Operand[] operands = GetHalfUnpacked(context, GetSrcCbuf(context, cbufSlot, cbufOffset), swizzle); return FPAbsNeg(context, operands, absolute, negate); }