aboutsummaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2022-06-29 17:21:03 -0700
committerPierre-Marie de Rodat <derodat@adacore.com>2022-07-12 12:24:14 +0000
commit33338e7289288404de79cb57dd1003a7552fb3d4 (patch)
tree35881d6a00ecfce6720838f858d12d38e6a64b01 /gcc/system.h
parent729d2e2a80768b6df008ea98979dbe34b7e4ab9a (diff)
downloadgcc-33338e7289288404de79cb57dd1003a7552fb3d4.zip
gcc-33338e7289288404de79cb57dd1003a7552fb3d4.tar.gz
gcc-33338e7289288404de79cb57dd1003a7552fb3d4.tar.bz2
[Ada] Use right implementation type for nonbinary-modulus ops
If the flag Opt.Expand_Nonbinary_Modular_Ops is set (which occurs if -gnateg is specified) then we implement predefined operations for a modular type whose modulus is not a power of two by converting the operands to some other type (either a signed integer type or a modular type with a power-of-two modulus), doing the operation in that representation, and converting back. If the bounds of the chosen type are too narrow, then problems with intermediate overflow can result. But there are performance advantages to choosing narrower bounds (and to prefering an unsigned choice over a signed choice of the same size) when multiple safe choices are available. gcc/ada/ * exp_ch4.adb (Expand_Nonbinary_Modular_Op.Expand_Modular_Op): Reimplement choice of which predefined type to use for the implementation of a predefined operation of a modular type with a non-power-of-two modulus.
Diffstat (limited to 'gcc/system.h')
0 files changed, 0 insertions, 0 deletions