CodeGenCommon.cs 445 B

12345678910111213141516171819
  1. using ARMeilleure.IntermediateRepresentation;
  2. namespace ARMeilleure.CodeGen.X86
  3. {
  4. static class CodeGenCommon
  5. {
  6. public static bool IsLongConst(Operand op)
  7. {
  8. long value = op.Type == OperandType.I32 ? op.AsInt32() : op.AsInt64();
  9. return !ConstFitsOnS32(value);
  10. }
  11. private static bool ConstFitsOnS32(long value)
  12. {
  13. return value == (int)value;
  14. }
  15. }
  16. }