summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2020-05-08 16:18:55 +0200
committerMarge Bot <eric+marge@anholt.net>2020-05-19 17:05:05 +0000
commit34f2c4dc6a6d62677bb7478a70e71b0e5719fc4c (patch)
tree00f047dd6f75bbc41ccf22cb8a96f471847999b5
parent3fba5bb9cc49aa526ce9b108229aa7e01349275d (diff)
aco: validate v_interp_*_f16 as VOP3 instructions instead of VINTRP
16-bit interp instructions are considered VINTRP by the compiler but they are emitted as VOP3 by the assembler. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4966>
-rw-r--r--src/amd/compiler/aco_validate.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp
index 3323acf9899..95cc1df3ffd 100644
--- a/src/amd/compiler/aco_validate.cpp
+++ b/src/amd/compiler/aco_validate.cpp
@@ -85,8 +85,19 @@ void validate(Program* program, FILE * output)
base_format = Format::VOP2;
else if ((uint32_t)base_format & (uint32_t)Format::VOPC)
base_format = Format::VOPC;
- else if ((uint32_t)base_format & (uint32_t)Format::VINTRP)
- base_format = Format::VINTRP;
+ else if ((uint32_t)base_format & (uint32_t)Format::VINTRP) {
+ if (instr->opcode == aco_opcode::v_interp_p1ll_f16 ||
+ instr->opcode == aco_opcode::v_interp_p1lv_f16 ||
+ instr->opcode == aco_opcode::v_interp_p2_legacy_f16 ||
+ instr->opcode == aco_opcode::v_interp_p2_f16) {
+ /* v_interp_*_fp16 are considered VINTRP by the compiler but
+ * they are emitted as VOP3.
+ */
+ base_format = Format::VOP3;
+ } else {
+ base_format = Format::VINTRP;
+ }
+ }
check(base_format == instr_info.format[(int)instr->opcode], "Wrong base format for instruction", instr.get());
/* check VOP3 modifiers */