From da0c3b02e71c7552ba9324a01a73602094105fcc Mon Sep 17 00:00:00 2001 From: Juha-Pekka Heikkila Date: Fri, 28 Mar 2014 15:28:32 +0200 Subject: [PATCH] i965/fs: Add support for the MAC instruction. This allows us to generate the MAC (multiply-accumulate) instruction, which can be used to implement some expressions in fewer instructions than doing a series of MUL and ADDs. Reviewed-by: Kenneth Graunke Reviewed-by: Matt Turner Signed-off-by: Juha-Pekka Heikkila --- src/mesa/drivers/dri/i965/brw_fs.cpp | 1 + src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 075857f7425..c550c412229 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -196,6 +196,7 @@ ALU3(MAD) ALU2_ACC(ADDC) ALU2_ACC(SUBB) ALU2(SEL) +ALU2(MAC) /** Gen4 predicated IF. */ fs_inst * diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp index 1cf35b40ad2..c6b4aae4087 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp @@ -1545,6 +1545,9 @@ fs_generator::generate_code(exec_list *instructions, FILE *dump_file) assert(brw->gen >= 7); brw_SUBB(p, dst, src[0], src[1]); break; + case BRW_OPCODE_MAC: + brw_MAC(p, dst, src[0], src[1]); + break; case BRW_OPCODE_BFE: assert(brw->gen >= 7); -- 2.30.2