aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 079e9d8..daa0ddb 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -3436,10 +3436,13 @@ build_modrm_byte ()
source = 0;
break;
case 3:
- /* When there are 3 operands, one of them must be immediate,
- which may be the first or the last operand. */
- assert (i.imm_operands == 1);
- source = (i.types[0] & Imm) ? 1 : 0;
+ /* When there are 3 operands, one of them may be immediate,
+ which may be the first or the last operand. Otherwise,
+ the first operand must be shift count register (cl). */
+ assert (i.imm_operands == 1
+ || (i.imm_operands == 0
+ && (i.types[0] & ShiftCount)));
+ source = (i.types[0] & (Imm | ShiftCount)) ? 1 : 0;
break;
case 4:
/* When there are 4 operands, the first two must be immediate