Lib/Target/instr/Imm.cpp
/**
 * Return a representation of the value which is suitable for adding
 * to a (vc4) instruction
 */
Return a representation of the value which is suitable for adding
to a (vc4) instruction
Return a representation of the value which is suitable for adding to a ( vc4 ) instruction
uint32_t Imm::encode() const {
  assert(sizeof(m_intVal)   == sizeof(uint32_t));
  assert(sizeof(m_floatVal) == sizeof(uint32_t));
  if (m_tag == IMM_FLOAT32) {
    auto *tmp = (uint32_t *) &m_floatVal;
    return *tmp;
  }
  return (uint32_t) m_intVal;
}
uint32_t Imm :: encode ( ) const { assert ( sizeof ( m_intVal ) == sizeof ( uint32_t ) ) ; assert ( sizeof ( m_floatVal ) == sizeof ( uint32_t ) ) ; if ( m_tag == IMM_FLOAT32 ) { auto * tmp = ( uint32_t * ) & m_floatVal ; return * tmp ; } return ( uint32_t ) m_intVal ; }
Return a representation of the value which is suitable for adding
 to a (vc4) instruction
Return a representation of the value which is suitable for adding to a ( vc4 ) instruction