i965/fs: Stop using fs_reg::in_range() in favor of regions_overlap().
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 2 Sep 2016 02:36:23 +0000 (19:36 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 14 Sep 2016 21:50:55 +0000 (14:50 -0700)
Its only use left in the FS back-end should be using regions_overlap()
instead to avoid getting a false negative result in cases where source
and destination overlap but the former starts before the latter in the
VGRF file.

v2: Put back lost components factor (Iago).

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index 42ed131854e610a8f8247e66578af4e81bd8245d..a5679a138ec5f751c4b6836c9c72aa389941b4f0 100644 (file)
@@ -4820,7 +4820,9 @@ shuffle_64bit_data_for_32bit_write(const fs_builder &bld,
    assert(type_sz(src.type) == 8);
    assert(type_sz(dst.type) == 4);
 
-   assert(!src.in_range(dst, 2 * components * bld.dispatch_width() / 8));
+   assert(!regions_overlap(
+             dst, 2 * components * dst.component_size(bld.dispatch_width()),
+             src, components * src.component_size(bld.dispatch_width())));
 
    for (unsigned i = 0; i < components; i++) {
       const fs_reg component_i = offset(src, bld, i);