Lib/Support/Platform.cpp
/**
 * Returns the number of available registers in a register file for the current
 * target platform
 *
 * For `vc4`, which has two register files 'A' and 'B' per QPU, returns the size
 * of each register file.
 * `v3d` has one single dual-port register file 'A' per QPU.
 *
 * Current implementation assumes no multi-threading has been enabled on the
 * QPU's. If that ever happens (not likely in this project), the size becomes
 * `size/num_threads`.
 *
 * However, according to internet hearsay, the default and minimum number of
 * threads for `v3d` is actually 2 per QPU. Still, 64 for `v3d` appears to be the
 * correct return value in this case.
 *
 * This all goes to show that something that appears to be exceedingly simple in
 * concept can actually be convoluted as f*** underwater.
 */
Returns the number of available registers in a register file for the current
target platform

For `vc4`, which has two register files 'A' and 'B' per QPU, returns the size
of each register file.
`v3d` has one single dual-port register file 'A' per QPU.

Current implementation assumes no multi-threading has been enabled on the
QPU's. If that ever happens (not likely in this project), the size becomes
`size/num_threads`.

However, according to internet hearsay, the default and minimum number of
threads for `v3d` is actually 2 per QPU. Still, 64 for `v3d` appears to be the
correct return value in this case.

This all goes to show that something that appears to be exceedingly simple in
concept can actually be convoluted as f*** underwater.
Returns the number of available registers in a register file for the current target platform For ` vc4 ` which has two register files ' A ' and ' B ' per QPU returns the size of each register file . ` v3d ` has one single dual - port register file ' A ' per QPU . Current implementation assumes no multi - threading has been enabled on the QPU ' s . If that ever happens ( not likely in this project ) the size becomes ` size / num_threads ` . However according to internet hearsay the default and minimum number of threads for ` v3d ` is actually 2 per QPU . Still 64 for ` v3d ` appears to be the correct return value in this case . This all goes to show that something that appears to be exceedingly simple in concept can actually be convoluted as f *** underwater .
int Platform::size_regfile() {
  if (compiling_for_vc4()) {
    return 32;
  } else {
    return 64;
  }
}
int Platform :: size_regfile ( ) { if ( compiling_for_vc4 ( ) ) { return 32 ; } else { return 64 ; } }
Returns the number of available registers in a register file for the current
 target platform
Returns the number of available registers in a register file for the current target platform