+static int
+adjust_broadcast_modifier (char **opnd)
+{
+ char *str, *next, *last, *op;
+ int bcst_type = INT_MAX;
+
+ /* Skip the immediate operand. */
+ op = opnd[0];
+ if (strcasecmp(op, "Imm8") == 0)
+ op = opnd[1];
+
+ op = xstrdup (op);
+ last = op + strlen (op);
+ for (next = op; next && next < last; )
+ {
+ str = next_field (next, '|', &next, last);
+ if (str)
+ {
+ if (strcasecmp(str, "Byte") == 0)
+ {
+ /* The smalest broadcast type, no need to check
+ further. */
+ bcst_type = BYTE_BROADCAST;
+ break;
+ }
+ else if (strcasecmp(str, "Word") == 0)
+ {
+ if (bcst_type > WORD_BROADCAST)
+ bcst_type = WORD_BROADCAST;
+ }
+ else if (strcasecmp(str, "Dword") == 0)
+ {
+ if (bcst_type > DWORD_BROADCAST)
+ bcst_type = DWORD_BROADCAST;
+ }
+ else if (strcasecmp(str, "Qword") == 0)
+ {
+ if (bcst_type > QWORD_BROADCAST)
+ bcst_type = QWORD_BROADCAST;
+ }
+ }
+ }
+ free (op);
+
+ if (bcst_type == INT_MAX)
+ fail (_("unknown broadcast operand: %s\n"), op);
+
+ return bcst_type;
+}
+