gallium: use tgsi_get_opcode_name instead of tgsi_opcode_info::mnemonic
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 2 Aug 2017 10:05:34 +0000 (12:05 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 23 Aug 2017 11:54:55 +0000 (13:54 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/gallivm/lp_bld_tgsi.c
src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c
src/gallium/auxiliary/tgsi/tgsi_dump.c
src/gallium/auxiliary/tgsi/tgsi_sanity.c
src/gallium/auxiliary/tgsi/tgsi_text.c

index ebd4fe5f6a908263d64e40af1af6c8638c14b733..d7e92aa8387a707b481b181a48633e4890a56023 100644 (file)
@@ -531,7 +531,7 @@ lp_build_tgsi_llvm(
          tgsi_get_opcode_info(instr->Instruction.Opcode);
       if (!lp_build_tgsi_inst_llvm(bld_base, instr)) {
          _debug_printf("warning: failed to translate tgsi opcode %s to LLVM\n",
-                       opcode_info->mnemonic);
+                       tgsi_get_opcode_name(instr->Instruction.Opcode));
          return FALSE;
       }
    }
index b76c065e324afca21071102b819feae44ed851d2..2529c6a8bf943576e35f31d09f3d004dda3cc001 100644 (file)
@@ -956,7 +956,7 @@ lp_build_tgsi_aos(struct gallivm_state *gallivm,
          tgsi_get_opcode_info(instr->Instruction.Opcode);
       if (!lp_emit_instruction_aos(&bld, instr, opcode_info, &pc))
          _debug_printf("warning: failed to translate tgsi opcode %s to LLVM\n",
-                       opcode_info->mnemonic);
+                       tgsi_get_opcode_name(instr->Instruction.Opcode));
    }
 
    if (0) {
index b58e64511cec06df079b1f4cb90e395e606aab2f..f6c85390e9099e6f080c9cffdc49c42f2d84d5e9 100644 (file)
@@ -578,7 +578,7 @@ iter_instruction(
       TXT( "  " );
    ctx->indent += info->post_indent;
 
-   TXT( info->mnemonic );
+   TXT( tgsi_get_opcode_name(inst->Instruction.Opcode) );
 
    if (inst->Instruction.Saturate) {
       TXT( "_SAT" );
index a95bbfa9880f4cda3fcf66960825356f3623cb4b..2c9ad9933315a1ac758fa7e3cbb0a3d4593988b1 100644 (file)
@@ -326,10 +326,12 @@ iter_instruction(
    }
 
    if (info->num_dst != inst->Instruction.NumDstRegs) {
-      report_error( ctx, "%s: Invalid number of destination operands, should be %u", info->mnemonic, info->num_dst );
+      report_error( ctx, "%s: Invalid number of destination operands, should be %u",
+                    tgsi_get_opcode_name(inst->Instruction.Opcode), info->num_dst );
    }
    if (info->num_src != inst->Instruction.NumSrcRegs) {
-      report_error( ctx, "%s: Invalid number of source operands, should be %u", info->mnemonic, info->num_src );
+      report_error( ctx, "%s: Invalid number of source operands, should be %u",
+                    tgsi_get_opcode_name(inst->Instruction.Opcode), info->num_src );
    }
 
    /* Check destination and source registers' validity.
index 4cb67c5f0632f729452157b9ace64bbecc3e12e3..02241a66bfe68f30f5e8a06f4e28700d4f5a05e1 100644 (file)
@@ -1003,16 +1003,17 @@ match_inst(const char **pcur,
            const struct tgsi_opcode_info *info)
 {
    const char *cur = *pcur;
+   const char *mnemonic = tgsi_get_opcode_name(info->opcode);
 
    /* simple case: the whole string matches the instruction name */
-   if (str_match_nocase_whole(&cur, info->mnemonic)) {
+   if (str_match_nocase_whole(&cur, mnemonic)) {
       *pcur = cur;
       *saturate = 0;
       *precise = 0;
       return TRUE;
    }
 
-   if (str_match_no_case(&cur, info->mnemonic)) {
+   if (str_match_no_case(&cur, mnemonic)) {
       /* the instruction has a suffix, figure it out */
       if (str_match_no_case(&cur, "_SAT")) {
          *pcur = cur;