summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/tgsi
diff options
context:
space:
mode:
authorMichal Krol <michal@vmware.com>2009-04-01 11:49:55 +0200
committerMichal Krol <michal@vmware.com>2009-04-01 11:49:55 +0200
commitdaec1035a2d23ee4d3122f10fd6e676216527d53 (patch)
tree177348db55eeda381dbe6ad77cd8b96d8727f9d0 /src/gallium/auxiliary/tgsi
parent1aa4b79dc772825cabfcc97de90b7247cc4b10a0 (diff)
tgsi: Lookup alternate instruction mnemonics when parsing tgsi text.
Diffstat (limited to 'src/gallium/auxiliary/tgsi')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_text.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c
index 58fe07c11d..fdaee9b060 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_text.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
@@ -741,6 +741,26 @@ static const char *texture_names[TGSI_TEXTURE_COUNT] =
};
static boolean
+match_inst_mnemonic(const char **pcur,
+ const struct tgsi_opcode_info *info)
+{
+ if (str_match_no_case(pcur, info->mnemonic)) {
+ return TRUE;
+ }
+ if (info->alt_mnemonic1) {
+ if (str_match_no_case(pcur, info->alt_mnemonic1)) {
+ return TRUE;
+ }
+ if (info->alt_mnemonic2) {
+ if (str_match_no_case(pcur, info->alt_mnemonic2)) {
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+
+static boolean
parse_instruction(
struct translate_ctx *ctx,
boolean has_label )
@@ -758,7 +778,7 @@ parse_instruction(
const char *cur = ctx->cur;
info = tgsi_get_opcode_info( i );
- if (str_match_no_case( &cur, info->mnemonic )) {
+ if (match_inst_mnemonic(&cur, info)) {
if (str_match_no_case( &cur, "_SATNV" ))
saturate = TGSI_SAT_MINUS_PLUS_ONE;
else if (str_match_no_case( &cur, "_SAT" ))