summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.pick_status.json2
-rw-r--r--src/intel/compiler/brw_fs_nir.cpp10
2 files changed, 11 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 33a365be759..2787b9c9c01 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -76,7 +76,7 @@
"description": "intel/fs: Correctly handle multiply of fsign with a source modifier",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "06d2c116415c0ab163a57ed7f2522342ed43e4d4"
},
diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp
index 2d6b248d5fe..8b5d819dda8 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -880,6 +880,16 @@ fs_visitor::emit_fsign(const fs_builder &bld, const nir_alu_instr *instr,
}
op[0] = offset(op[0], bld, fsign_instr->src[0].swizzle[channel]);
+
+ /* Resolve any source modifiers. We could do slightly better on Gen8+
+ * if the only source modifier is negation, but *shrug*.
+ */
+ if (op[1].negate || op[1].abs) {
+ fs_reg tmp = bld.vgrf(op[1].type);
+
+ bld.MOV(tmp, op[1]);
+ op[1] = tmp;
+ }
} else {
assert(!instr->dest.saturate);
}