Exemple #1
0
        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
        /// </returns>
        public override bool Equals(SigType other)
        {
            ArraySigType ast = other as ArraySigType;

            if (null == ast)
            {
                return(false);
            }

            return(base.Equals(other) && _rank == ast._rank && Equal(_sizes, ast._sizes) && Equal(_lowbounds, ast._lowbounds));
        }
Exemple #2
0
        /// <summary>
        /// Validates the instruction operands and creates a matching variable for the result.
        /// </summary>
        /// <param name="ctx">The context.</param>
        /// <param name="compiler">The compiler.</param>
        public override void Validate(Context ctx, IMethodCompiler compiler)
        {
            base.Validate(ctx, compiler);

            Mosa.Runtime.Metadata.Signatures.ArraySigType a = ctx.Operand1.Type as Mosa.Runtime.Metadata.Signatures.ArraySigType;
            if (null == a || 1 != a.Rank)
            {
                throw new InvalidProgramException(@"Operand to ldlen is not a vector.");
            }
            ctx.Result = compiler.CreateTemporary(new SigType(CilElementType.I));
        }