@@ -78,31 +78,33 @@ function Effects(e::Effects = EFFECTS_UNKNOWN;
78
78
end
79
79
80
80
is_total_or_error (effects:: Effects ) =
81
- effects. consistent === ALWAYS_TRUE && effects. effect_free === ALWAYS_TRUE &&
81
+ effects. consistent === ALWAYS_TRUE &&
82
+ effects. effect_free === ALWAYS_TRUE &&
82
83
effects. terminates === ALWAYS_TRUE
83
84
84
85
is_total (effects:: Effects ) =
85
- is_total_or_error (effects) && effects. nothrow === ALWAYS_TRUE
86
+ is_total_or_error (effects) &&
87
+ effects. nothrow === ALWAYS_TRUE
86
88
87
89
is_removable_if_unused (effects:: Effects ) =
88
90
effects. effect_free === ALWAYS_TRUE &&
89
91
effects. terminates === ALWAYS_TRUE &&
90
92
effects. nothrow === ALWAYS_TRUE
91
93
92
94
function encode_effects (e:: Effects )
93
- return (e. consistent. state << 1 ) |
94
- (e. effect_free. state << 3 ) |
95
- (e. nothrow. state << 5 ) |
96
- (e. terminates. state << 7 ) |
97
- (e. overlayed)
95
+ return (e. consistent. state << 0 ) |
96
+ (e. effect_free. state << 2 ) |
97
+ (e. nothrow. state << 4 ) |
98
+ (e. terminates. state << 6 ) |
99
+ (UInt32 ( e. overlayed) << 8 )
98
100
end
99
- function decode_effects (e:: UInt8 )
101
+ function decode_effects (e:: UInt32 )
100
102
return Effects (
101
- TriState ((e >> 1 ) & 0x03 ),
102
- TriState ((e >> 3 ) & 0x03 ),
103
- TriState ((e >> 5 ) & 0x03 ),
104
- TriState ((e >> 7 ) & 0x03 ),
105
- e & 0x01 ≠ 0x00 ,
103
+ TriState ((e >> 0 ) & 0x03 ),
104
+ TriState ((e >> 2 ) & 0x03 ),
105
+ TriState ((e >> 4 ) & 0x03 ),
106
+ TriState ((e >> 6 ) & 0x03 ),
107
+ _Bool ( (e >> 8 ) & 0x01 ) ,
106
108
false )
107
109
end
108
110
0 commit comments