factor out common input folding and add an optimization when FMAs are available
factor out common input folding and add an optimization when FMAs are available

chr-engwer/Vc,VcDevel/Vc,VcDevel/Vc,chr-engwer/Vc,VcDevel/Vc,VcDevel/Vc,chr-engwer/Vc