// rounding rules.
switch (dir) {
case round_direction::kToZero:
- break;
+ break;
case round_direction::kToPositiveInfinity:
round_away_from_zero = !isNegative();
break;
case round_direction::kToNearestEven:
// Have to round down, round bit is 0
if ((first_rounded_bit & significand) == 0) {
- break;
+ break;
}
if (((significand & throwaway_mask) & ~first_rounded_bit) != 0) {
// If any subsequent bit of the rounded portion is non-0 then we round
if (is_nan) {
typename other_T::uint_type shifted_significand;
shifted_significand = static_cast<typename other_T::uint_type>(
- negatable_left_shift<other_T::num_fraction_bits -
- num_fraction_bits>::val(significand));
+ negatable_left_shift<static_cast<int_type>(other_T::num_fraction_bits) -
+ static_cast<int_type>(
+ num_fraction_bits)>::val(significand));
// We are some sort of Nan. We try to keep the bit-pattern of the Nan
// as close as possible. If we had to shift off bits so we are 0, then we
// representation.
class Disassembler {
public:
- Disassembler(const libspirv::AssemblyGrammar& grammar, uint32_t const* words,
+ Disassembler(const libspirv::AssemblyGrammar& grammar,
uint32_t options)
- : words_(words),
- grammar_(grammar),
+ : grammar_(grammar),
print_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_PRINT, options)),
color_(print_ &&
spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COLOR, options)),
if (color_) out_.get() << libspirv::clr::green();
}
- // The SPIR-V binary. The endianness is not necessarily converted
- // to native endianness.
- const uint32_t* const words_;
const libspirv::AssemblyGrammar& grammar_;
const bool print_; // Should we also print to the standard output stream?
const bool color_; // Should we print in colour?
const libspirv::AssemblyGrammar grammar(context);
if (!grammar.isValid()) return SPV_ERROR_INVALID_TABLE;
- Disassembler disassembler(grammar, code, options);
+ Disassembler disassembler(grammar, options);
if (auto error = spvBinaryParse(context, &disassembler, code, wordCount,
DisassembleHeader, DisassembleInstruction,
pDiagnostic)) {