diff options
| author | LDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com> | 2020-07-09 02:45:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-09 10:45:24 +1000 |
| commit | c050994995268494d46a6cac1d4ffa931effa0f6 (patch) | |
| tree | fe02cf3144ee2024bbc0119325ab237e8eba46f2 /ARMeilleure/CodeGen | |
| parent | 484eb645ae0611f60fae845ed011ed6115352e06 (diff) | |
Fix PPTC on Windows 7. (#1369)
* Fix PPTC on Windows 7.
* Address gdkchan comment.
Diffstat (limited to 'ARMeilleure/CodeGen')
| -rw-r--r-- | ARMeilleure/CodeGen/Optimizations/ConstantFolding.cs | 2 | ||||
| -rw-r--r-- | ARMeilleure/CodeGen/X86/Assembler.cs | 2 | ||||
| -rw-r--r-- | ARMeilleure/CodeGen/X86/X86Optimizer.cs | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/ARMeilleure/CodeGen/Optimizations/ConstantFolding.cs b/ARMeilleure/CodeGen/Optimizations/ConstantFolding.cs index eff53217..790fd53d 100644 --- a/ARMeilleure/CodeGen/Optimizations/ConstantFolding.cs +++ b/ARMeilleure/CodeGen/Optimizations/ConstantFolding.cs @@ -218,7 +218,7 @@ namespace ARMeilleure.CodeGen.Optimizations { Operand srcOp = operation.GetSource(index); - if (srcOp.Kind != OperandKind.Constant || srcOp.DisableCF) + if (srcOp.Kind != OperandKind.Constant || srcOp.Relocatable) { return false; } diff --git a/ARMeilleure/CodeGen/X86/Assembler.cs b/ARMeilleure/CodeGen/X86/Assembler.cs index 99df3cb5..62ca05b2 100644 --- a/ARMeilleure/CodeGen/X86/Assembler.cs +++ b/ARMeilleure/CodeGen/X86/Assembler.cs @@ -914,7 +914,7 @@ namespace ARMeilleure.CodeGen.X86 WriteByte((byte)imm); } - else if (IsImm32(imm, type) && info.OpRMImm32 != BadOp) + else if (!source.Relocatable && IsImm32(imm, type) && info.OpRMImm32 != BadOp) { WriteOpCode(dest, null, null, type, info.Flags, info.OpRMImm32); diff --git a/ARMeilleure/CodeGen/X86/X86Optimizer.cs b/ARMeilleure/CodeGen/X86/X86Optimizer.cs index 30fd6c71..643b515f 100644 --- a/ARMeilleure/CodeGen/X86/X86Optimizer.cs +++ b/ARMeilleure/CodeGen/X86/X86Optimizer.cs @@ -31,7 +31,7 @@ namespace ARMeilleure.CodeGen.X86 Operand src1 = operation.GetSource(0); Operand src2 = operation.GetSource(1); - if (src1.Kind == OperandKind.Constant && CodeGenCommon.IsLongConst(src1)) + if (src1.Kind == OperandKind.Constant && (src1.Relocatable || CodeGenCommon.IsLongConst(src1))) { Operand temp = Local(src1.Type); @@ -42,7 +42,7 @@ namespace ARMeilleure.CodeGen.X86 operation.SetSource(0, temp); } - if (src2.Kind == OperandKind.Constant && CodeGenCommon.IsLongConst(src2)) + if (src2.Kind == OperandKind.Constant && (src2.Relocatable || CodeGenCommon.IsLongConst(src2))) { Operand temp = Local(src2.Type); |
