MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / bits_set

Function bits_set

test/hex_float_test.cpp:689–696  ·  view source on GitHub ↗

Sets the bits from MSB to LSB of the significand part of a float. For example 0 would set the bit 23 (counting from LSB to MSB), and 1 would set the 22nd bit.

Source from the content-addressed store, hash-verified

687// For example 0 would set the bit 23 (counting from LSB to MSB),
688// and 1 would set the 22nd bit.
689uint32_t bits_set(const std::vector<uint32_t>& bits) {
690 const uint32_t top_bit = 1u << 22u;
691 uint32_t val = 0;
692 for (uint32_t i : bits) {
693 val |= top_bit >> i;
694 }
695 return val;
696}
697
698// The same as bits_set but for a Float16 value instead of 32-bit floating
699// point.

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected