Advertisement
zhar66

ECHO

Jun 24th, 2019
1,229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ⇟⁂⁇‱※‽ϴΨ⳧~#["
  2.  
  3. /*
  4.  * Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
  5.  *
  6.  * Permission is hereby granted, free of charge, to any person obtaining a
  7.  * copy of this software and associated documentation files (the "Software"),
  8.  * to deal in the Software without restriction, including without limitation
  9.  * on the rights to use, copy, modify, merge, publish, distribute, sub
  10.  * license, and/or sell copies of the Software, and to permit persons to whom
  11.  * the Software is furnished to do so, subject to the following conditions:
  12.  *
  13.  * The above copyright notice and this permission notice (including the next
  14.  * paragraph) shall be included in all copies or substantial portions of the
  15.  * Software.
  16.  *
  17.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19.  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  20.  * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
  21.  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  22.  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  23.  * USE OR OTHER DEALINGS IN THE SOFTWARE.
  24.  */
  25. #include "r600_pipe.h"
  26. #include "r600_opcodes.h"
  27. #include "r600_shader.h"
  28.  
  29. #include "util/u_memory.h"
  30. #include "eg_sq.h"
  31. #include <errno.h>
  32.  
  33. int eg_bytecode_cf_build(struct r600_bytecode *bc, struct r600_bytecode_cf *cf)
  34. {
  35.     unsigned id = cf->id;
  36.  
  37.     if (cf->op == CF_NATIVE) {
  38.         bc->bytecode[id++] = cf->isa[0];
  39.         bc->bytecode[id++] = cf->isa[1];
  40.     } else {
  41.         const struct cf_op_info *cfop = r600_isa_cf(cf->op);
  42.         unsigned opcode = r600_isa_cf_opcode(bc->isa->hw_class, cf->op);
  43.         if (cfop->flags & CF_ALU) { /* ALU clauses */
  44.  
  45.             /* prepend ALU_EXTENDED if we need more than 2 kcache sets */
  46.             if (cf->eg_alu_extended) {
  47.                 bc->bytecode[id++] =
  48.                         S_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE0(cf->kcache[0].index_mode) |
  49.                         S_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE1(cf->kcache[1].index_mode) |
  50.                         S_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE2(cf->kcache[2].index_mode) |
  51.                         S_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE3(cf->kcache[3].index_mode) |
  52.                         S_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK2(cf->kcache[2].bank) |
  53.                         S_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK3(cf->kcache[3].bank) |
  54.                         S_SQ_CF_ALU_WORD0_EXT_KCACHE_MODE2(cf->kcache[2].mode);
  55.                 bc->bytecode[id++] =
  56.                         S_SQ_CF_ALU_WORD1_EXT_CF_INST(
  57.                             r600_isa_cf_opcode(bc->isa->hw_class, CF_OP_ALU_EXT)) |
  58.                         S_SQ_CF_ALU_WORD1_EXT_KCACHE_MODE3(cf->kcache[3].mode) |
  59.                         S_SQ_CF_ALU_WORD1_EXT_KCACHE_ADDR2(cf->kcache[2].addr) |
  60.                         S_SQ_CF_ALU_WORD1_EXT_KCACHE_ADDR3(cf->kcache[3].addr) |
  61.                         S_SQ_CF_ALU_WORD1_EXT_BARRIER(1);
  62.             }
  63.             bc->bytecode[id++] = S_SQ_CF_ALU_WORD0_ADDR(cf->addr >> 1) |
  64.                     S_SQ_CF_ALU_WORD0_KCACHE_MODE0(cf->kcache[0].mode) |
  65.                     S_SQ_CF_ALU_WORD0_KCACHE_BANK0(cf->kcache[0].bank) |
  66.                     S_SQ_CF_ALU_WORD0_KCACHE_BANK1(cf->kcache[1].bank);
  67.             bc->bytecode[id++] = S_SQ_CF_ALU_WORD1_CF_INST(opcode) |
  68.                     S_SQ_CF_ALU_WORD1_KCACHE_MODE1(cf->kcache[1].mode) |
  69.                     S_SQ_CF_ALU_WORD1_KCACHE_ADDR0(cf->kcache[0].addr) |
  70.                     S_SQ_CF_ALU_WORD1_KCACHE_ADDR1(cf->kcache[1].addr) |
  71.                     S_SQ_CF_ALU_WORD1_BARRIER(1) |
  72.                     S_SQ_CF_ALU_WORD1_COUNT((cf->ndw / 2) - 1);
  73.         } else if (cfop->flags & CF_CLAUSE) {
  74.             /* CF_TEX/VTX (CF_ALU already handled above) */
  75.             bc->bytecode[id++] = S_SQ_CF_WORD0_ADDR(cf->addr >> 1);
  76.             bc->bytecode[id] = S_SQ_CF_WORD1_CF_INST(opcode) |
  77.                     S_SQ_CF_WORD1_BARRIER(1) |
  78.                     S_SQ_CF_WORD1_VALID_PIXEL_MODE(cf->vpm) |
  79.                     S_SQ_CF_WORD1_COUNT((cf->ndw / 4) - 1);
  80.             if (bc->chip_class == EVERGREEN) /* no EOP on cayman */
  81.                 bc->bytecode[id] |= S_SQ_CF_ALLOC_EXPORT_WORD1_END_OF_PROGRAM(cf->end_of_program);
  82.             id++;
  83.         } else if (cfop->flags & CF_EXP) {
  84.             /* EXPORT instructions */
  85.             bc->bytecode[id++] = S_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR(cf->output.gpr) |
  86.                     S_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE(cf->output.elem_size) |
  87.                     S_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE(cf->output.array_base) |
  88.                     S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(cf->output.type) |
  89.                     S_SQ_CF_ALLOC_EXPORT_WORD0_INDEX_GPR(cf->output.index_gpr);
  90.             bc->bytecode[id] =
  91.                     S_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT(cf->output.burst_count - 1) |
  92.                     S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_X(cf->output.swizzle_x) |
  93.                     S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Y(cf->output.swizzle_y) |
  94.                     S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Z(cf->output.swizzle_z) |
  95.                     S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_W(cf->output.swizzle_w) |
  96.                     S_SQ_CF_ALLOC_EXPORT_WORD1_BARRIER(cf->barrier) |
  97.                     S_SQ_CF_ALLOC_EXPORT_WORD1_MARK(cf->mark) |
  98.                     S_SQ_CF_ALLOC_EXPORT_WORD1_CF_INST(opcode);
  99.  
  100.             if (bc->chip_class == EVERGREEN) /* no EOP on cayman */
  101.                 bc->bytecode[id] |= S_SQ_CF_ALLOC_EXPORT_WORD1_END_OF_PROGRAM(cf->end_of_program);
  102.             id++;
  103.         } else if (cfop->flags & CF_RAT) {
  104.             bc->bytecode[id++] = S_SQ_CF_ALLOC_EXPORT_WORD0_RAT_RAT_ID(cf->rat.id) |
  105.                     S_SQ_CF_ALLOC_EXPORT_WORD0_RAT_RAT_INST(cf->rat.inst) |
  106.                     S_SQ_CF_ALLOC_EXPORT_WORD0_RAT_RAT_INDEX_MODE(cf->rat.index_mode) |
  107.                     S_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR(cf->output.gpr) |
  108.                     S_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE(cf->output.elem_size) |
  109.                     S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(cf->output.type) |
  110.                     S_SQ_CF_ALLOC_EXPORT_WORD0_INDEX_GPR(cf->output.index_gpr);
  111.             bc->bytecode[id] = S_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT(cf->output.burst_count - 1) |
  112.                     S_SQ_CF_ALLOC_EXPORT_WORD1_BARRIER(cf->barrier) |
  113.                     S_SQ_CF_ALLOC_EXPORT_WORD1_MARK(cf->mark) |
  114.                             S_SQ_CF_ALLOC_EXPORT_WORD1_VALID_PIXEL_MODE(cf->vpm) |
  115.                     S_SQ_CF_ALLOC_EXPORT_WORD1_CF_INST(opcode) |
  116.                     S_SQ_CF_ALLOC_EXPORT_WORD1_BUF_COMP_MASK(cf->output.comp_mask) |
  117.                     S_SQ_CF_ALLOC_EXPORT_WORD1_BUF_ARRAY_SIZE(cf->output.array_size) |
  118.                     S_SQ_CF_ALLOC_EXPORT_WORD1_MARK(cf->output.mark);
  119.             if (bc->chip_class == EVERGREEN) /* no EOP on cayman */
  120.                 bc->bytecode[id] |= S_SQ_CF_ALLOC_EXPORT_WORD1_END_OF_PROGRAM(cf->end_of_program);
  121.             id++;
  122.  
  123.         } else if (cfop->flags & CF_MEM) {
  124.             /* MEM_STREAM, MEM_RING instructions */
  125.             bc->bytecode[id++] = S_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR(cf->output.gpr) |
  126.                     S_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE(cf->output.elem_size) |
  127.                     S_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE(cf->output.array_base) |
  128.                     S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(cf->output.type) |
  129.                     S_SQ_CF_ALLOC_EXPORT_WORD0_INDEX_GPR(cf->output.index_gpr);
  130.             bc->bytecode[id] = S_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT(cf->output.burst_count - 1) |
  131.                     S_SQ_CF_ALLOC_EXPORT_WORD1_BARRIER(cf->barrier) |
  132.                     S_SQ_CF_ALLOC_EXPORT_WORD1_MARK(cf->mark) |
  133.                     S_SQ_CF_ALLOC_EXPORT_WORD1_CF_INST(opcode) |
  134.                     S_SQ_CF_ALLOC_EXPORT_WORD1_BUF_COMP_MASK(cf->output.comp_mask) |
  135.                     S_SQ_CF_ALLOC_EXPORT_WORD1_BUF_ARRAY_SIZE(cf->output.array_size);
  136.             if (bc->chip_class == EVERGREEN) /* no EOP on cayman */
  137.                 bc->bytecode[id] |= S_SQ_CF_ALLOC_EXPORT_WORD1_END_OF_PROGRAM(cf->end_of_program);
  138.             id++;
  139.         } else {
  140.             /* other instructions */
  141.             bc->bytecode[id++] = S_SQ_CF_WORD0_ADDR(cf->cf_addr >> 1);
  142.             bc->bytecode[id] = S_SQ_CF_WORD1_CF_INST(opcode) |
  143.                     S_SQ_CF_WORD1_VALID_PIXEL_MODE(cf->vpm) |
  144.                     S_SQ_CF_WORD1_BARRIER(1) |
  145.                     S_SQ_CF_WORD1_COND(cf->cond) |
  146.                     S_SQ_CF_WORD1_POP_COUNT(cf->pop_count) |
  147.                     S_SQ_CF_WORD1_COUNT(cf->count);
  148.             if (bc->chip_class == EVERGREEN) /* no EOP on cayman */
  149.                 bc->bytecode[id] |= S_SQ_CF_ALLOC_EXPORT_WORD1_END_OF_PROGRAM(cf->end_of_program);
  150.             id++;
  151.         }
  152.     }
  153.     return 0;
  154. }
  155.  
  156. #if 0
  157. void eg_bytecode_export_read(struct r600_bytecode *bc,
  158.         struct r600_bytecode_output *output, uint32_t word0, uint32_t word1)
  159. {
  160.     output->array_base = G_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE(word0);
  161.     output->type = G_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(word0);
  162.     output->gpr = G_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR(word0);
  163.     output->elem_size = G_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE(word0);
  164.  
  165.     output->swizzle_x = G_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_X(word1);
  166.     output->swizzle_y = G_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Y(word1);
  167.     output->swizzle_z = G_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Z(word1);
  168.     output->swizzle_w = G_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_W(word1);
  169.     output->burst_count = G_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT(word1);
  170.     output->end_of_program = G_SQ_CF_ALLOC_EXPORT_WORD1_END_OF_PROGRAM(word1);
  171.     output->op = r600_isa_cf_by_opcode(bc->isa,
  172.             G_SQ_CF_ALLOC_EXPORT_WORD1_CF_INST(word1), /* is_cf_alu = */ 0 );
  173.     output->barrier = G_SQ_CF_ALLOC_EXPORT_WORD1_BARRIER(word1);
  174.     output->array_size = G_SQ_CF_ALLOC_EXPORT_WORD1_BUF_ARRAY_SIZE(word1);
  175.     output->comp_mask = G_SQ_CF_ALLOC_EXPORT_WORD1_BUF_COMP_MASK(word1);
  176. }
  177. #endif
  178.  
  179. int egcm_load_index_reg(struct r600_bytecode *bc, unsigned id, bool inside_alu_clause)
  180. {
  181.     struct r600_bytecode_alu alu;
  182.     int r;
  183.     unsigned type;
  184.  
  185.     assert(id < 2);
  186.     assert(bc->chip_class >= EVERGREEN);
  187.  
  188.     if (bc->index_loaded[id])
  189.         return 0;
  190.  
  191.     memset(&alu, 0, sizeof(alu));
  192.     alu.op = ALU_OP1_MOVA_INT;
  193.     alu.src[0].sel = bc->index_reg[id];
  194.     alu.src[0].chan = 0;
  195.     if (bc->chip_class == CAYMAN)
  196.         alu.dst.sel = id == 0 ? CM_V_SQ_MOVA_DST_CF_IDX0 : CM_V_SQ_MOVA_DST_CF_IDX1;
  197.  
  198.     alu.last = 1;
  199.     r = r600_bytecode_add_alu(bc, &alu);
  200.     if (r)
  201.         return r;
  202.  
  203.     bc->ar_loaded = 0; /* clobbered */
  204.  
  205.     if (bc->chip_class == EVERGREEN) {
  206.         memset(&alu, 0, sizeof(alu));
  207.         alu.op = id == 0 ? ALU_OP0_SET_CF_IDX0 : ALU_OP0_SET_CF_IDX1;
  208.         alu.last = 1;
  209.         r = r600_bytecode_add_alu(bc, &alu);
  210.         if (r)
  211.             return r;
  212.     }
  213.  
  214.     /* Must split ALU group as index only applies to following group */
  215.     if (inside_alu_clause) {
  216.         type = bc->cf_last->op;
  217.         if ((r = r600_bytecode_add_cf(bc))) {
  218.             return r;
  219.         }
  220.         bc->cf_last->op = type;
  221.     }
  222.  
  223.     bc->index_loaded[id] = 1;
  224.  
  225.     return 0;
  226. }
  227.  
  228. int eg_bytecode_gds_build(struct r600_bytecode *bc, struct r600_bytecode_gds *gds, unsigned id)
  229. {
  230.     unsigned gds_op = (r600_isa_fetch_opcode(bc->isa->hw_class, gds->op) >> 8) & 0x3f;
  231.     unsigned opcode;
  232.     if (gds->op == FETCH_OP_TF_WRITE) {
  233.         opcode = 5;
  234.         gds_op = 0;
  235.     } else
  236.         opcode = 4;
  237.     bc->bytecode[id++] = S_SQ_MEM_GDS_WORD0_MEM_INST(2) |
  238.         S_SQ_MEM_GDS_WORD0_MEM_OP(opcode) |
  239.         S_SQ_MEM_GDS_WORD0_SRC_GPR(gds->src_gpr) |
  240.         S_SQ_MEM_GDS_WORD0_SRC_REL(gds->src_rel) |
  241.         S_SQ_MEM_GDS_WORD0_SRC_SEL_X(gds->src_sel_x) |
  242.         S_SQ_MEM_GDS_WORD0_SRC_SEL_Y(gds->src_sel_y) |
  243.         S_SQ_MEM_GDS_WORD0_SRC_SEL_Z(gds->src_sel_z);
  244.  
  245.     bc->bytecode[id++] = S_SQ_MEM_GDS_WORD1_DST_GPR(gds->dst_gpr) |
  246.         S_SQ_MEM_GDS_WORD1_DST_REL(gds->dst_rel) |
  247.         S_SQ_MEM_GDS_WORD1_GDS_OP(gds_op) |
  248.         S_SQ_MEM_GDS_WORD1_SRC_GPR(gds->src_gpr2) |
  249.         S_SQ_MEM_GDS_WORD1_UAV_INDEX_MODE(gds->uav_index_mode) |
  250.         S_SQ_MEM_GDS_WORD1_UAV_ID(gds->uav_id) |
  251.         S_SQ_MEM_GDS_WORD1_ALLOC_CONSUME(gds->alloc_consume) |
  252.         S_SQ_MEM_GDS_WORD1_BCAST_FIRST_REQ(gds->bcast_first_req);
  253.  
  254.     bc->bytecode[id++] = S_SQ_MEM_GDS_WORD2_DST_SEL_X(gds->dst_sel_x) |
  255.         S_SQ_MEM_GDS_WORD2_DST_SEL_Y(gds->dst_sel_y) |
  256.         S_SQ_MEM_GDS_WORD2_DST_SEL_Z(gds->dst_sel_z) |
  257.         S_SQ_MEM_GDS_WORD2_DST_SEL_W(gds->dst_sel_w);
  258.     return 0;
  259. }
  260.  
  261. int eg_bytecode_alu_build(struct r600_bytecode *bc, struct r600_bytecode_alu *alu, unsigned id)
  262. {
  263.     if (alu->is_lds_idx_op) {
  264.         assert(!alu->src[0].abs && !alu->src[1].abs && !alu->src[2].abs);
  265.         assert(!alu->src[0].neg && !alu->src[1].neg && !alu->src[2].neg);
  266.         bc->bytecode[id++] = S_SQ_ALU_WORD0_SRC0_SEL(alu->src[0].sel) |
  267.             S_SQ_ALU_WORD0_SRC0_REL(alu->src[0].rel) |
  268.             S_SQ_ALU_WORD0_SRC0_CHAN(alu->src[0].chan) |
  269.             S_SQ_ALU_WORD0_LDS_IDX_OP_IDX_OFFSET_4(alu->lds_idx >> 4) |
  270.             S_SQ_ALU_WORD0_SRC1_SEL(alu->src[1].sel) |
  271.             S_SQ_ALU_WORD0_SRC1_REL(alu->src[1].rel) |
  272.             S_SQ_ALU_WORD0_SRC1_CHAN(alu->src[1].chan) |
  273.             S_SQ_ALU_WORD0_LDS_IDX_OP_IDX_OFFSET_5(alu->lds_idx >> 5) |
  274.             S_SQ_ALU_WORD0_INDEX_MODE(alu->index_mode) |
  275.             S_SQ_ALU_WORD0_PRED_SEL(alu->pred_sel) |
  276.             S_SQ_ALU_WORD0_LAST(alu->last);
  277.     } else {
  278.         bc->bytecode[id++] = S_SQ_ALU_WORD0_SRC0_SEL(alu->src[0].sel) |
  279.             S_SQ_ALU_WORD0_SRC0_REL(alu->src[0].rel) |
  280.             S_SQ_ALU_WORD0_SRC0_CHAN(alu->src[0].chan) |
  281.             S_SQ_ALU_WORD0_SRC0_NEG(alu->src[0].neg) |
  282.             S_SQ_ALU_WORD0_SRC1_SEL(alu->src[1].sel) |
  283.             S_SQ_ALU_WORD0_SRC1_REL(alu->src[1].rel) |
  284.             S_SQ_ALU_WORD0_SRC1_CHAN(alu->src[1].chan) |
  285.             S_SQ_ALU_WORD0_SRC1_NEG(alu->src[1].neg) |
  286.             S_SQ_ALU_WORD0_PRED_SEL(alu->pred_sel) |
  287.             S_SQ_ALU_WORD0_LAST(alu->last);
  288.     }
  289.  
  290.     /* don't replace gpr by pv or ps for destination register */
  291.     if (alu->is_lds_idx_op) {
  292.         unsigned lds_op = r600_isa_alu_opcode(bc->isa->hw_class, alu->op);
  293.         bc->bytecode[id++] =
  294.             S_SQ_ALU_WORD1_OP3_SRC2_SEL(alu->src[2].sel) |
  295.             S_SQ_ALU_WORD1_OP3_SRC2_REL(alu->src[2].rel) |
  296.             S_SQ_ALU_WORD1_OP3_SRC2_CHAN(alu->src[2].chan) |
  297.             S_SQ_ALU_WORD1_LDS_IDX_OP_IDX_OFFSET_1(alu->lds_idx >> 1) |
  298.  
  299.             S_SQ_ALU_WORD1_OP3_ALU_INST(lds_op & 0xff) |
  300.             S_SQ_ALU_WORD1_BANK_SWIZZLE(alu->bank_swizzle) |
  301.             S_SQ_ALU_WORD1_LDS_IDX_OP_LDS_OP((lds_op >> 8) & 0xff) |
  302.             S_SQ_ALU_WORD1_LDS_IDX_OP_IDX_OFFSET_0(alu->lds_idx) |
  303.             S_SQ_ALU_WORD1_LDS_IDX_OP_IDX_OFFSET_2(alu->lds_idx >> 2) |
  304.             S_SQ_ALU_WORD1_DST_CHAN(alu->dst.chan) |
  305.             S_SQ_ALU_WORD1_LDS_IDX_OP_IDX_OFFSET_3(alu->lds_idx >> 3);
  306.  
  307.     } else if (alu->is_op3) {
  308.         assert(!alu->src[0].abs && !alu->src[1].abs && !alu->src[2].abs);
  309.         bc->bytecode[id++] = S_SQ_ALU_WORD1_DST_GPR(alu->dst.sel) |
  310.                     S_SQ_ALU_WORD1_DST_CHAN(alu->dst.chan) |
  311.                             S_SQ_ALU_WORD1_DST_REL(alu->dst.rel) |
  312.                             S_SQ_ALU_WORD1_CLAMP(alu->dst.clamp) |
  313.                     S_SQ_ALU_WORD1_OP3_SRC2_SEL(alu->src[2].sel) |
  314.                     S_SQ_ALU_WORD1_OP3_SRC2_REL(alu->src[2].rel) |
  315.                     S_SQ_ALU_WORD1_OP3_SRC2_CHAN(alu->src[2].chan) |
  316.                     S_SQ_ALU_WORD1_OP3_SRC2_NEG(alu->src[2].neg) |
  317.                     S_SQ_ALU_WORD1_OP3_ALU_INST(r600_isa_alu_opcode(bc->isa->hw_class, alu->op)) |
  318.                     S_SQ_ALU_WORD1_BANK_SWIZZLE(alu->bank_swizzle);
  319.     } else {
  320.         bc->bytecode[id++] = S_SQ_ALU_WORD1_DST_GPR(alu->dst.sel) |
  321.                     S_SQ_ALU_WORD1_DST_CHAN(alu->dst.chan) |
  322.                             S_SQ_ALU_WORD1_DST_REL(alu->dst.rel) |
  323.                             S_SQ_ALU_WORD1_CLAMP(alu->dst.clamp) |
  324.                     S_SQ_ALU_WORD1_OP2_SRC0_ABS(alu->src[0].abs) |
  325.                     S_SQ_ALU_WORD1_OP2_SRC1_ABS(alu->src[1].abs) |
  326.                     S_SQ_ALU_WORD1_OP2_WRITE_MASK(alu->dst.write) |
  327.                     S_SQ_ALU_WORD1_OP2_OMOD(alu->omod) |
  328.                     S_SQ_ALU_WORD1_OP2_ALU_INST(r600_isa_alu_opcode(bc->isa->hw_class, alu->op)) |
  329.                     S_SQ_ALU_WORD1_BANK_SWIZZLE(alu->bank_swizzle) |
  330.                             S_SQ_ALU_WORD1_OP2_UPDATE_EXECUTE_MASK(alu->execute_mask) |
  331.                             S_SQ_ALU_WORD1_OP2_UPDATE_PRED(alu->update_pred);
  332.     }
  333.     return 0;
  334. }
  335.  
  336. ]; ->⮸
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement