Goose  Artifact [38b93f4439]

Artifact 38b93f44393a201a11797a05f3a7477e000da8d7a187c77acb4b4f0c9e9d013c:

  • File bs/cir/arith.h — part of check-in [b4d5bdf6ec] at 2022-06-18 18:51:47 on branch cir-stack-language —
    • Added a location id to all CIR instructions (needed with the stack based approach to locate intermediate results)
    • Fixed a bunch of verifier errors
    • Re-enabled most verifier tests, other than some requiring to re-implement a few more bits
    (user: zlodo size: 2075) [more...]

#ifndef GOOSE_CIR_ARITH_H
#define GOOSE_CIR_ARITH_H

namespace goose::cir
{
    class Add : public BinaryOp
    {
        public:
            Add( LocationId loc ) :
                BinaryOp( loc )
            {}

            friend ostream& operator<<( ostream& out, const Add& ins )
            {
                return out << "ADD";
            }
    };

    class Sub : public BinaryOp
    {
        public:
            Sub( LocationId loc ) :
                BinaryOp( loc )
            {}

            friend ostream& operator<<( ostream& out, const Sub& ins )
            {
                return out << "SUB";
            }
    };

    class Mul : public BinaryOp
    {
        public:
            Mul( LocationId loc ) :
                BinaryOp( loc )
            {}

            friend ostream& operator<<( ostream& out, const Mul& ins )
            {
                return out << "MUL";
            }
    };

    class UDiv : public BinaryOp
    {
        public:
            UDiv( LocationId loc ) :
                BinaryOp( loc )
            {}

            friend ostream& operator<<( ostream& out, const UDiv& ins )
            {
                return out << "UDIV";
            }
    };

    class SDiv : public BinaryOp
    {
        public:
            SDiv( LocationId loc ) :
                BinaryOp( loc )
            {}

            friend ostream& operator<<( ostream& out, const SDiv& ins )
            {
                return out << "SDIV";
            }
    };

    class URem : public BinaryOp
    {
        public:
            URem( LocationId loc ) :
                BinaryOp( loc )
            {}

            friend ostream& operator<<( ostream& out, const URem& ins )
            {
                return out << "UREM";
            }
    };

    class SRem : public BinaryOp
    {
        public:
            SRem( LocationId loc ) :
                BinaryOp( loc )
            {}

            friend ostream& operator<<( ostream& out, const SRem& ins )
            {
                return out << "SREM";
            }
    };
}

#endif