i965/fs: Add and use an fs_inst copy constructor.
authorMatt Turner <mattst88@gmail.com>
Thu, 20 Feb 2014 17:40:02 +0000 (09:40 -0800)
committerMatt Turner <mattst88@gmail.com>
Sun, 1 Jun 2014 20:29:23 +0000 (13:29 -0700)
Will get more complicated when fs_reg src becomes a pointer.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h

index 1a83c8c2c2c2641434d6347a524caa90d45ac667..af458babde80f864c5f9275879cead737335625c 100644 (file)
@@ -139,6 +139,11 @@ fs_inst::fs_inst(enum opcode opcode, fs_reg dst,
       assert(src[2].reg_offset >= 0);
 }
 
+fs_inst::fs_inst(const fs_inst &that)
+{
+   memcpy(this, &that, sizeof(that));
+}
+
 #define ALU1(op)                                                        \
    fs_inst *                                                            \
    fs_visitor::op(fs_reg dst, fs_reg src0)                              \
index 789f0b38c5355f473b43389ff297c80ed1af434d..bda233c29df97f9b0f156d69f7483dec9d1c4a73 100644 (file)
@@ -197,6 +197,7 @@ public:
    fs_inst(enum opcode opcode, fs_reg dst, fs_reg src0, fs_reg src1);
    fs_inst(enum opcode opcode, fs_reg dst,
            fs_reg src0, fs_reg src1,fs_reg src2);
+   fs_inst(const fs_inst &that);
 
    bool equals(fs_inst *inst) const;
    bool overwrites_reg(const fs_reg &reg) const;