[Ada] Improve efficiency of small slice assignments of packed arrays
commit9418d3d41f581edd9acfdc4f359d37f948c1671e
authorBob Duff <duff@adacore.com>
Tue, 30 Mar 2021 11:15:39 +0000 (30 07:15 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 21 Jun 2021 10:45:14 +0000 (21 06:45 -0400)
tree482346fcb7b87707e2e6f69fc1c235601292a911
parentc3681eba728a487f042de72e90c29b1cfca4e2e7
[Ada] Improve efficiency of small slice assignments of packed arrays

gcc/ada/

* rtsfind.ads, libgnat/s-bitfie.ads, libgnat/s-bituti.adb,
libgnat/s-bituti.ads (Fast_Copy_Bitfield): New run-time library
function to copy bit fields faster than Copy_Bitfield. Cannot be
called with zero-size bit fields.  Remove obsolete ??? comments
from s-bituti.adb; we already do "avoid calling this if
Forwards_OK is False".
* exp_ch5.adb (Expand_Assign_Array_Loop_Or_Bitfield,
Expand_Assign_Array_Bitfield_Fast): Generate calls to
Fast_Copy_Bitfield when appropriate.
* sem_util.adb, sem_util.ads (Get_Index_Bounds): Two new
functions for getting the index bounds. These are more
convenient than the procedure of the same name, because they can
be used to initialize constants.
gcc/ada/exp_ch5.adb
gcc/ada/libgnat/s-bitfie.ads
gcc/ada/libgnat/s-bituti.adb
gcc/ada/libgnat/s-bituti.ads
gcc/ada/rtsfind.ads
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads