diff options
author | Matt Turner <mattst88@gmail.com> | 2018-12-20 13:44:16 -0500 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2019-01-08 22:12:38 -0800 |
commit | c62399343c0b799ffe2e7eaa051f7587c2509a25 (patch) | |
tree | 203a16fb12668c0c026e3f9f12099968ac6f606a | |
parent | 61b743b99b9f31b133a9b0775d77c3f1439d22f7 (diff) |
intel/compiler: Lower more 64-bit MOV/SEL operationsfp64
-rw-r--r-- | src/intel/compiler/brw_fs.cpp | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 924082badef..ed9f789955a 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -2412,8 +2412,6 @@ fs_visitor::opt_algebraic() inst->dst.type == BRW_REGISTER_TYPE_Q)) { assert(inst->dst.type == inst->src[0].type); assert(!inst->saturate); - assert(!inst->src[0].abs); - assert(!inst->src[0].negate); const brw::fs_builder ibld(this, block, inst); if (inst->src[0].file == IMM) { @@ -2421,13 +2419,38 @@ fs_visitor::opt_algebraic() brw_imm_ud(inst->src[0].u64 >> 32)); ibld.MOV(subscript(inst->dst, BRW_REGISTER_TYPE_UD, 0), brw_imm_ud(inst->src[0].u64)); + inst->remove(block); + progress = true; + continue; + } else if (inst->src[0].negate && inst->src[0].abs) { + inst->src[0].negate = false; + inst->src[0].abs = false; + + ibld.OR(subscript(inst->dst, BRW_REGISTER_TYPE_UD, 1), + subscript(inst->src[0], BRW_REGISTER_TYPE_UD, 1), + brw_imm_ud(0x80000000)); + } else if (inst->src[0].negate) { + inst->src[0].negate = false; + inst->src[0].abs = false; + + ibld.XOR(subscript(inst->dst, BRW_REGISTER_TYPE_UD, 1), + subscript(inst->src[0], BRW_REGISTER_TYPE_UD, 1), + brw_imm_ud(0x80000000)); + } else if (inst->src[0].abs) { + inst->src[0].negate = false; + inst->src[0].abs = false; + + ibld.AND(subscript(inst->dst, BRW_REGISTER_TYPE_UD, 1), + subscript(inst->src[0], BRW_REGISTER_TYPE_UD, 1), + brw_imm_ud(0x7fffffff)); } else { ibld.MOV(subscript(inst->dst, BRW_REGISTER_TYPE_UD, 1), subscript(inst->src[0], BRW_REGISTER_TYPE_UD, 1)); - ibld.MOV(subscript(inst->dst, BRW_REGISTER_TYPE_UD, 0), - subscript(inst->src[0], BRW_REGISTER_TYPE_UD, 0)); } + ibld.MOV(subscript(inst->dst, BRW_REGISTER_TYPE_UD, 0), + subscript(inst->src[0], BRW_REGISTER_TYPE_UD, 0)); + inst->remove(block); progress = true; } |