Move some functions from arm.d to util.d