public static void Bfc(ArmEmitterContext context) { OpCode32AluBf op = (OpCode32AluBf)context.CurrOp; Operand d = GetIntA32(context, op.Rd); Operand res = context.BitwiseAnd(d, Const(~op.DestMask)); SetIntA32(context, op.Rd, res); }
public static void Ubfx(ArmEmitterContext context) { OpCode32AluBf op = (OpCode32AluBf)context.CurrOp; var msb = op.Lsb + op.Msb; // For this instruction, the msb is actually a width. Operand n = GetIntA32(context, op.Rn); Operand res = context.ShiftRightUI(context.ShiftLeft(n, Const(31 - msb)), Const(31 - op.Msb)); SetIntA32(context, op.Rd, res); }
public static void Bfi(ArmEmitterContext context) { OpCode32AluBf op = (OpCode32AluBf)context.CurrOp; Operand n = GetIntA32(context, op.Rn); Operand d = GetIntA32(context, op.Rd); Operand part = context.BitwiseAnd(n, Const(op.SourceMask)); if (op.Lsb != 0) { part = context.ShiftLeft(part, Const(op.Lsb)); } Operand res = context.BitwiseAnd(d, Const(~op.DestMask)); res = context.BitwiseOr(res, context.BitwiseAnd(part, Const(op.DestMask))); SetIntA32(context, op.Rd, res); }