accel_lut: deal with overflow correctly