Files
ryujinx/src/Ryujinx.HLE/HOS/Tamper/Operations/OpXor.cs
2025-12-30 18:52:41 -06:00

31 lines
835 B
C#

using System.Numerics;
namespace Ryujinx.HLE.HOS.Tamper.Operations
{
sealed class OpXorFactory : IOperationFactory
{
private OpXorFactory() { }
public static IOperation CreateFor<T>(IOperand destination, IOperand lhs, IOperand rhs) where T : unmanaged, IBinaryInteger<T>
=> new OpXor<T>(destination, lhs, rhs);
}
class OpXor<T> : IOperation where T : unmanaged, IBinaryNumber<T>
{
readonly IOperand _destination;
readonly IOperand _lhs;
readonly IOperand _rhs;
public OpXor(IOperand destination, IOperand lhs, IOperand rhs)
{
_destination = destination;
_lhs = lhs;
_rhs = rhs;
}
public void Execute()
{
_destination.Set(_lhs.Get<T>() ^ _rhs.Get<T>());
}
}
}