Exemple #1
0
    /// <summary>
    /// Decision to fast tail call
    /// </summary>
    /// <remarks>
    ///
    /// On x64 linux this will fast tail call.
    ///
    /// The caller uses 3 integer registers (2 args, one ret buf)
    /// The callee uses 6 integer registers (5 args, one ret buf)
    ///
    /// Return 100 is a pass.
    /// Return 112 is a failure.
    ///
    /// </remarks>
    public static int DoubleCountRetBuffCaller(int i)
    {
        if (i % 2 == 0)
        {
            StructSizeThirtyTwo retVal = DoubleCountRetBuffCallerWrapper(4, 2);

            if (retVal.b == 4.0)
            {
                return(100);
            }
            else
            {
                return(112);
            }
        }
        else
        {
            StructSizeThirtyTwo retVal = DoubleCountRetBuffCallerWrapper(3, 1);

            if (retVal.b == 1.0)
            {
                return(100);
            }
            else
            {
                return(112);
            }
        }
    }
Exemple #2
0
    /// <summary>
    /// Decision to fast tail call. See StackBasedCaller for more
    /// information.
    /// </summary>
    public static int StackBasedCallee(int a, int b, StructSizeThirtyTwo sstt)
    {
        int count = 0;

        for (int i = 0; i < sstt.a; ++i)
        {
            if (i % 10 == 0)
            {
                ++count;
            }
        }

        if (count == 160)
        {
            return(100);
        }

        else
        {
            return(105);
        }
    }
Exemple #3
0
    /// <summary>
    /// Decision to fast tail call. See DoubleCountRetBuffCaller for more
    /// information.
    /// </summary>
    public static StructSizeThirtyTwo DoubleCountRetBuffCallee(StructSizeEightIntNotExplicit sstf,
                                                               StructSizeEightIntNotExplicit sstf2,
                                                               StructSizeEightIntNotExplicit sstf3,
                                                               StructSizeEightIntNotExplicit sstf4,
                                                               StructSizeEightIntNotExplicit sstf5)
    {
        int a = sstf.a;
        int b = sstf.b;

        StructSizeThirtyTwo retVal = new StructSizeThirtyTwo(b, a, a, b);

        int count = 0;

        for (int i = 0; i < b; ++i)
        {
            if (i % 2 == 0)
            {
                ++count;
            }
        }

        return(retVal);
    }