Przeglądaj źródła

Fold ConvertI64ToI32 imm64 (#1359)

* Fold ConvertI64ToI32 imm64

* Increment PTC version

* Bump PPTC InternalVersion

Co-authored-by: jduncanator <1518948+jduncanator@users.noreply.github.com>
Ficture Seven 5 lat temu
rodzic
commit
7639bb2e86

+ 7 - 0
ARMeilleure/CodeGen/Optimizations/ConstantFolding.cs

@@ -78,6 +78,13 @@ namespace ARMeilleure.CodeGen.Optimizations
                     }
                     break;
 
+                case Instruction.ConvertI64ToI32:
+                    if (type == OperandType.I32)
+                    {
+                        EvaluateUnaryI64(operation, (x) => (int)x);
+                    }
+                    break;
+
                 case Instruction.Copy:
                     if (type == OperandType.I32)
                     {

+ 1 - 1
ARMeilleure/Translation/PTC/Ptc.cs

@@ -20,7 +20,7 @@ namespace ARMeilleure.Translation.PTC
     {
         private const string HeaderMagic = "PTChd";
 
-        private const int InternalVersion = 3; //! To be incremented manually for each change to the ARMeilleure project.
+        private const int InternalVersion = 4; //! To be incremented manually for each change to the ARMeilleure project.
 
         private const string BaseDir = "Ryujinx";