/// <summary> /// Arc-cosine; the result is in the range 0 to + π. /// </summary> /// <param name="em">Emitter object</param> public static void ACOS(Emitter em) { if (em == null) { throw new ArgumentNullException("em"); } em.Emit0(OpCodes.Call, typeof(Math).GetMethod("Acos", new [] { typeof(double) })); }
/// <summary> /// Converts to integer by truncation. /// </summary> /// <param name="em">Emitter object</param> /// <param name="typeWanted">The type of the argument</param> public static void AINT(Emitter em, Type typeWanted) { if (em == null) { throw new ArgumentNullException("em"); } em.Emit0(OpCodes.Conv_I4); em.ConvertSystemType(typeWanted); }
/// <summary> /// Returns the absolute of the given value. /// </summary> /// <param name="em">Emitter object</param> /// <param name="typeWanted">The type of the argument</param> public static void ABS(Emitter em, Type typeWanted) { if (em == null) { throw new ArgumentNullException("em"); } if (typeWanted == typeof(Complex)) { em.Emit0(OpCodes.Call, typeof(Complex).GetMethod("Abs", new [] { typeWanted })); } else { em.Emit0(OpCodes.Call, typeof(Math).GetMethod("Abs", new [] { typeWanted })); } }
/// <summary> /// Initializes a new instance of the <see cref="CCompiler.Temporaries"/> class /// using the given emitter. /// </summary> /// <param name="em">A code generator Emitter</param> public Temporaries(Emitter em) { _em = em; _locals = new Collection<LocalDescriptor>(); }
/// <summary> /// Emit inline code for SNGL function. /// </summary> /// <param name="em">Emitter object</param> public static void SNGL(Emitter em) { if (em == null) { throw new ArgumentNullException("em"); } em.Emit0(OpCodes.Conv_R4); }
/// <summary> /// Emit inline code for REAL function. /// </summary> /// <param name="em">Emitter object</param> /// <param name="typeWanted">The type of the argument</param> public static void REAL(Emitter em, Type typeWanted) { if (em == null) { throw new ArgumentNullException("em"); } if (typeWanted == typeof(Complex)) { em.Emit0(OpCodes.Call, typeof(JComLib.Intrinsics).GetMethod("REAL", new [] { typeof(Complex) })); } else { em.Emit0(OpCodes.Conv_R4); } }
/// <summary> /// Inline generator for MOD function. /// </summary> /// <param name="em">Emitter object</param> public static void MOD(Emitter em) { if (em == null) { throw new ArgumentNullException("em"); } em.Emit0(OpCodes.Rem); }
/// <summary> /// Returns length of the character argument. /// </summary> /// <param name="em">Emitter object</param> /// <param name="typeWanted">The type of the argument</param> public static void LEN(Emitter em, Type typeWanted) { if (em == null) { throw new ArgumentNullException("em"); } if (typeWanted == null) { throw new ArgumentNullException("typeWanted"); } em.Emit0(OpCodes.Call, typeWanted.GetMethod("get_Length")); }
/// <summary> /// Returns position of first character of the string in the local character code table. /// </summary> /// <param name="em">Emitter object</param> /// <param name="typeWanted">The type of the argument</param> public static void ICHAR(Emitter em, Type typeWanted) { if (em == null) { throw new ArgumentNullException("em"); } if (typeWanted == null) { throw new ArgumentNullException("typeWanted"); } em.LoadInteger(0); em.Emit0(OpCodes.Call, typeWanted.GetMethod("get_Chars", new [] { typeof(int) })); }
/// <summary> /// SQRT intrinsic function /// Returns the square root of the given value. /// </summary> /// <param name="em">Emitter object</param> public static void CSQRT(Emitter em) { if (em == null) { throw new ArgumentNullException("em"); } em.Emit0(OpCodes.Call, typeof(Complex).GetMethod("Sqrt", new [] { typeof(Complex) })); }
/// <summary> /// Convert the specified value to a complex value. /// </summary> /// <param name="em">Emitter object</param> public static void CMPLX(Emitter em) { if (em == null) { throw new ArgumentNullException("em"); } em.Emit0(OpCodes.Newobj, typeof(Complex).GetConstructor(new [] { typeof(double), typeof(double) } )); }
/// <summary> /// Returns Nth character in local character code table. /// </summary> /// <param name="em">Emitter object</param> public static void CHAR(Emitter em) { if (em == null) { throw new ArgumentNullException("em"); } em.Emit0(OpCodes.Conv_U2); em.CreateObject(typeof(JComLib.FixedString), new [] { typeof(char) }); }