i965/fs: Simplify get_fpu_lowered_simd_width() by using inequalities instead of rounding.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 7 Sep 2016 20:32:25 +0000 (13:32 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 14 Sep 2016 21:50:56 +0000 (14:50 -0700)
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i965/brw_fs.cpp

index 4c38b18483c9024a64b477018a6d779db27db68a..62b1c568f79de5b7d4892369e8dff4b698efd976 100644 (file)
@@ -4599,8 +4599,8 @@ get_fpu_lowered_simd_width(const struct gen_device_info *devinfo,
     */
    if (devinfo->gen < 8) {
       for (unsigned i = 0; i < inst->sources; i++) {
-         if (DIV_ROUND_UP(inst->size_written, REG_SIZE) == 2 &&
-             inst->size_read(i) != 0 && DIV_ROUND_UP(inst->size_read(i), REG_SIZE) != 2 &&
+         if (inst->size_written > REG_SIZE &&
+             inst->size_read(i) != 0 && inst->size_read(i) <= REG_SIZE &&
              !is_uniform(inst->src[i]) &&
              !(type_sz(inst->dst.type) == 4 && inst->dst.stride == 1 &&
                type_sz(inst->src[i].type) == 2 && inst->src[i].stride == 1)) {