IVGCVSW-863 Move clamp, for_each, foldl to misc/utility.h

Also, improve for_each, foldl, and related changes.

Change-Id: I0cf0c7dbf88f26bb70cc734ba9fb5725d405585f
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/114014
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
8 files changed