clean_ryujinx/src/Ryujinx.HLE/HOS/Tamper/Operations/OpNot.cs

24 lines
667 B
C#

using System.Numerics;
namespace Ryujinx.HLE.HOS.Tamper.Operations
{
class OpNot<T> : IOperation where T : unmanaged, IBinaryNumber<T>
{
readonly IOperand _destination;
readonly IOperand _source;
public OpNot(IOperand destination, IOperand source)
{
_destination = destination;
_source = source;
}
public void Execute()
{
_destination.Set(~_source.Get<T>());
}
public static IOperation CreateFor<T1>(IOperand destination, IOperand lhs, IOperand rhs) where T1 : unmanaged, IBinaryInteger<T1>
=> new OpNot<T1>(destination, lhs);
}
}