avcodec: optimize mathops for Loongson-3 v1