Address PR feedback

This commit is contained in:
gdkchan 2019-08-04 11:16:39 -03:00
commit cccf235b13
14 changed files with 31 additions and 59 deletions

View file

@ -45,15 +45,12 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
Dictionary<Register, OperandType> types = new Dictionary<Register, OperandType>(); Dictionary<Register, OperandType> types = new Dictionary<Register, OperandType>();
Queue<Register> pendingQueue = new Queue<Register>(); Queue<Register> pendingQueue = new Queue<Register>();
Queue<Register> readyQueue = new Queue<Register>(); Queue<Register> readyQueue = new Queue<Register>();
foreach (Copy copy in _copies) foreach (Copy copy in _copies)
{ {
locations[copy.Source] = copy.Source; locations[copy.Source] = copy.Source;
sources[copy.Dest] = copy.Source; sources[copy.Dest] = copy.Source;
types[copy.Dest] = copy.Type; types[copy.Dest] = copy.Type;
pendingQueue.Enqueue(copy.Dest); pendingQueue.Enqueue(copy.Dest);

View file

@ -268,7 +268,6 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
int availableRegisters = context.Masks.GetAvailableRegisters(regType); int availableRegisters = context.Masks.GetAvailableRegisters(regType);
int[] usePositions = new int[RegistersCount]; int[] usePositions = new int[RegistersCount];
int[] blockedPositions = new int[RegistersCount]; int[] blockedPositions = new int[RegistersCount];
for (int index = 0; index < RegistersCount; index++) for (int index = 0; index < RegistersCount; index++)
@ -426,7 +425,6 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
if (higuest < current) if (higuest < current)
{ {
higuest = current; higuest = current;
selected = index; selected = index;
if (current == int.MaxValue) if (current == int.MaxValue)

View file

@ -8,12 +8,10 @@ namespace ARMeilleure.CodeGen.X86
class Assembler class Assembler
{ {
private const int BadOp = 0; private const int BadOp = 0;
private const int OpModRMBits = 24; private const int OpModRMBits = 24;
private const byte RexPrefix = 0x40; private const byte RexPrefix = 0x40;
private const byte RexWPrefix = 0x48; private const byte RexWPrefix = 0x48;
private const byte LockPrefix = 0xf0; private const byte LockPrefix = 0xf0;
[Flags] [Flags]
@ -1037,7 +1035,6 @@ namespace ARMeilleure.CodeGen.X86
} }
bool needsSibByte = false; bool needsSibByte = false;
bool needsDisplacement = false; bool needsDisplacement = false;
int sib = 0; int sib = 0;
@ -1050,7 +1047,6 @@ namespace ARMeilleure.CodeGen.X86
X86Register baseRegLow = (X86Register)(baseReg.Index & 0b111); X86Register baseRegLow = (X86Register)(baseReg.Index & 0b111);
needsSibByte = memOp.Index != null || baseRegLow == X86Register.Rsp; needsSibByte = memOp.Index != null || baseRegLow == X86Register.Rsp;
needsDisplacement = memOp.Displacement != 0 || baseRegLow == X86Register.Rbp; needsDisplacement = memOp.Displacement != 0 || baseRegLow == X86Register.Rbp;
if (needsDisplacement) if (needsDisplacement)

View file

@ -116,7 +116,10 @@ namespace ARMeilleure.CodeGen.X86
int frameSize = calleeSaveRegionSize + allocResult.SpillRegionSize; int frameSize = calleeSaveRegionSize + allocResult.SpillRegionSize;
int callArgsAndFrameSize = frameSize + argsCount * 16; //FIXME * 16 => calc // TODO: Instead of always multiplying by 16 (the largest possible size of a variable,
// since a V128 has 16 bytes), we should calculate the exact size consumed by the
// arguments passed to the called functions on the stack.
int callArgsAndFrameSize = frameSize + argsCount * 16;
// Ensure that the Stack Pointer will be aligned to 16 bytes. // Ensure that the Stack Pointer will be aligned to 16 bytes.
callArgsAndFrameSize = (callArgsAndFrameSize + 0xf) & ~0xf; callArgsAndFrameSize = (callArgsAndFrameSize + 0xf) & ~0xf;

View file

@ -1308,7 +1308,6 @@ namespace ARMeilleure.CodeGen.X86
int mask1 = 0b11_10_01_00; int mask1 = 0b11_10_01_00;
mask0 = BitUtils.RotateRight(mask0, index * 2, 8); mask0 = BitUtils.RotateRight(mask0, index * 2, 8);
//mask1 = BitUtils.RotateLeft (mask1, index * 2, 8);
mask1 = BitUtils.RotateRight(mask1, 8 - index * 2, 8); mask1 = BitUtils.RotateRight(mask1, 8 - index * 2, 8);
context.Assembler.Pshufd(src1, src1, (byte)mask0); // Lane to be inserted in position 0. context.Assembler.Pshufd(src1, src1, (byte)mask0); // Lane to be inserted in position 0.

View file

@ -8,7 +8,7 @@ namespace ARMeilleure.Decoders
{ {
uint pc = GetPc(); uint pc = GetPc();
// When the codition is never, the instruction is BLX to Thumb mode. // When the condition is never, the instruction is BLX to Thumb mode.
if (Cond != Condition.Nv) if (Cond != Condition.Nv)
{ {
pc &= ~3u; pc &= ~3u;

View file

@ -3,6 +3,7 @@ namespace ARMeilleure.Decoders
class OpCodeAdr : OpCode class OpCodeAdr : OpCode
{ {
public int Rd { get; private set; } public int Rd { get; private set; }
public long Immediate { get; private set; } public long Immediate { get; private set; }
public OpCodeAdr(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode) public OpCodeAdr(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)

View file

@ -3,7 +3,9 @@ namespace ARMeilleure.Decoders
class OpCodeMov : OpCode class OpCodeMov : OpCode
{ {
public int Rd { get; private set; } public int Rd { get; private set; }
public long Immediate { get; private set; } public long Immediate { get; private set; }
public int Bit { get; private set; } public int Bit { get; private set; }
public OpCodeMov(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode) public OpCodeMov(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
@ -23,6 +25,7 @@ namespace ARMeilleure.Decoders
Bit = (opCode >> 21) & 0x3; Bit = (opCode >> 21) & 0x3;
Bit <<= 4; Bit <<= 4;
Immediate <<= Bit; Immediate <<= Bit;
RegisterSize = (opCode >> 31) != 0 RegisterSize = (opCode >> 31) != 0

View file

@ -56,9 +56,6 @@
// Use old ChocolArm64 ARM emulator // Use old ChocolArm64 ARM emulator
"enable_legacy_jit": false, "enable_legacy_jit": false,
// Enable or disable aggressive CPU optimizations
"enable_aggressive_cpu_opts": true,
// Enable or disable ignoring missing services, this may cause instability // Enable or disable ignoring missing services, this may cause instability
"ignore_missing_services": false, "ignore_missing_services": false,

View file

@ -113,11 +113,6 @@ namespace Ryujinx
/// </summary> /// </summary>
public bool EnableLegacyJit { get; private set; } public bool EnableLegacyJit { get; private set; }
/// <summary>
/// Enable or Disable aggressive CPU optimizations
/// </summary>
public bool EnableAggressiveCpuOpts { get; private set; }
/// <summary> /// <summary>
/// Enable or disable ignoring missing services /// Enable or disable ignoring missing services
/// </summary> /// </summary>
@ -247,11 +242,6 @@ namespace Ryujinx
device.System.UseLegacyJit = Instance.EnableLegacyJit; device.System.UseLegacyJit = Instance.EnableLegacyJit;
if (Instance.EnableAggressiveCpuOpts)
{
Optimizations.AssumeStrictAbiCompliance = true;
}
ServiceConfiguration.IgnoreMissingServices = Instance.IgnoreMissingServices; ServiceConfiguration.IgnoreMissingServices = Instance.IgnoreMissingServices;
if (Instance.GamepadControls.Enabled) if (Instance.GamepadControls.Enabled)

View file

@ -21,7 +21,6 @@
"enable_fs_integrity_checks", "enable_fs_integrity_checks",
"fs_global_access_log_mode", "fs_global_access_log_mode",
"enable_legacy_jit", "enable_legacy_jit",
"enable_aggressive_cpu_opts",
"controller_type", "controller_type",
"enable_keyboard", "enable_keyboard",
"keyboard_controls", "keyboard_controls",
@ -463,17 +462,6 @@
false false
] ]
}, },
"enable_aggressive_cpu_opts": {
"$id": "#/properties/enable_aggressive_cpu_opts",
"type": "boolean",
"title": "Enable Aggressive CPU Optimizations",
"description": "Enable or disable aggressive CPU optimizations",
"default": true,
"examples": [
true,
false
]
},
"ignore_missing_services": { "ignore_missing_services": {
"$id": "#/properties/ignore_missing_services", "$id": "#/properties/ignore_missing_services",
"type": "boolean", "type": "boolean",