Goose  Diff

Differences From Artifact [983f4a5930]:

  • File bs/builtins/operators/logic.cpp — part of check-in [1886f5f367] at 2019-08-03 19:29:43 on branch trunk — Implemented the runtime bitwise xor operator. (user: achavasse size: 5790)

To Artifact [e8b70cc119]:

  • File bs/builtins/operators/logic.cpp — part of check-in [011df3c4d3] at 2019-08-04 12:53:20 on branch trunk — logic ops: forbid xor between runtime integers of different signedness. (user: achavasse size: 5763)

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
            ForType< APSInt >( []( auto&& lhs, auto&& rhs ) -> Value
            {
                return BuildComputedValue( GetValueType< APSInt >(),
                    Xor( lhs, rhs ) );
            } ),

            // runtime integer xor, defined to work for any two integers of same
            // bit size but ignoring signedness difference.
            ForType< CustomPattern< RTInteger, RTInteger::SizeIntegerPat > >(
            []( auto&& lhs, auto&& rhs ) -> Value
            {
                return BuildComputedValue( lhs.type(),
                    Xor( lhs, rhs ) );
            } )
        );








|
|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
            ForType< APSInt >( []( auto&& lhs, auto&& rhs ) -> Value
            {
                return BuildComputedValue( GetValueType< APSInt >(),
                    Xor( lhs, rhs ) );
            } ),

            // runtime integer xor, defined to work for any two integers of same
            // bit size and signedness.
            ForType< CustomPattern< RTInteger, RTInteger::Pattern > >(
            []( auto&& lhs, auto&& rhs ) -> Value
            {
                return BuildComputedValue( lhs.type(),
                    Xor( lhs, rhs ) );
            } )
        );