On Wed, 8 May 2024, Kewen.Lin wrote: > to widen IFmode to TFmode. To make build_common_tree_nodes > be able to find the correct mode for long double type node, > it introduces one hook mode_for_longdouble to offer target > a way to specify the mode used for long double type node.
I don't really like layering a hook on top of the old target macro as a way to address a deficiency in the design of that target macro (floating types should have their mode, not a poorly defined precision value, specified directly by the target). A better hook design might be something like mode_for_floating_type (enum tree_index), where the argument is TI_FLOAT_TYPE, TI_DOUBLE_TYPE or TI_LONG_DOUBLE_TYPE, replacing all definitions and uses of FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE and LONG_DOUBLE_TYPE_SIZE with the single new hook and appropriate definitions for each target (with a default definition that uses SFmode for float and DFmode for double and long double, which would be suitable for many targets). -- Joseph S. Myers josmy...@redhat.com