Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Fixed shift operators precedence. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
4fe0527143d75268fd122e53d0b0ac2c |
| User & Date: | achavasse 2019-08-05 21:14:49.715 |
Context
|
2019-08-06
| ||
| 00:33 |
| |
|
2019-08-05
| ||
| 21:14 | Fixed shift operators precedence. check-in: 4fe0527143 user: achavasse tags: trunk | |
| 21:04 | Implemented the shift operators. check-in: 2fdf1d1929 user: achavasse tags: trunk | |
Changes
Changes to bs/builtins/operators/logic.cpp.
| ︙ | ︙ | |||
165 166 167 168 169 170 171 |
pEndBB->setTerminator( Ret( move( resultVal ) ) );
// Pachage our cfg in a value with an inline CFG instruction.
return BuildComputedValue( GetValueType< bool >(), move( cfg ) );
} )
);
| | | | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
pEndBB->setTerminator( Ret( move( resultVal ) ) );
// Pachage our cfg in a value with an inline CFG instruction.
return BuildComputedValue( GetValueType< bool >(), move( cfg ) );
} )
);
CreateLeftAssInfixOp( e, "<<"_sid, "operator_shift_left"_sid, precedence::BitShiftOp ,
// ct_int left shift
ForType< BigInt, Shl >(),
// runtime integer left shift, 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(),
Shl( lhs, rhs ) );
} )
);
CreateLeftAssInfixOp( e, ">>"_sid, "operator_shift_right"_sid, precedence::BitShiftOp ,
// ct_int right shift
ForType< BigInt, AShr >(),
// runtime signed integer right shift, defined to work for any two integers of same
// bit size.
ForType< CustomPattern< RTInteger, RTInteger::PatternSigned > >(
[]( auto&& lhs, auto&& rhs ) -> Value
|
| ︙ | ︙ |