On 9/7/24 7:06 PM, Andrew Carlotti wrote:


I forgot to explain how FPMR is used.

The FPMR register contains a large number of fields that control the data
formats and saturation/scaling behaviour used in various fp8 conversion an
multiplication intrinsics.  At present, I think there are 2^26 valid defined
values that an be used in the FPMR.  Furthermore, these values are not always
compile-time constants - we expect that devlopers will often reuse the same
compiled code (e.g. a matrix multiplication library routine) with different
formats or scaling/saturation behaviour selected at runtime (e.g. by passing a
parameter to the library routine).

(The specification for the FPRM register can be found at [1].  It's usage in
fp8 intrinsics is described in the draft ACLE spec at [2].)

As I understand it, the existing mode-switching pass infrastructure is built
around a small number of modes, where the choice of mode is a compile time
constant, and the total number of possible modes is fixed when building GCC.
Our usage of the FPMR register does not meet any of these criteria.  I don't
see how these limitations could be overcome with target hooks within the
contraints of the existing pass.
In which case you might want to look at how RISC-V is handling vsetvl to set the vector configuration. It's a target specific pass, but comes closer to what you're doing. It's still LCM based, but deals with some of the quirks of the RISC-V vector architecture.

Jeff

Reply via email to