aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-s390.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/tc-s390.c')
-rw-r--r--gas/config/tc-s390.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c
index 7bdf65e..6b93796 100644
--- a/gas/config/tc-s390.c
+++ b/gas/config/tc-s390.c
@@ -1354,8 +1354,9 @@ s390_insn (ignore)
expression (&exp);
if (exp.X_op == O_constant)
{
- if (opformat->oplen == 4 ||
- (opformat->oplen == 2 && exp.X_op < 0x10000))
+ if ((opformat->oplen == 6 && exp.X_op > 0 && exp.X_op < (1ULL << 48)) ||
+ (opformat->oplen == 4 && exp.X_op > 0 && exp.X_op < (1ULL << 32)) ||
+ (opformat->oplen == 2 && exp.X_op > 0 && exp.X_op < (1ULL << 16)))
md_number_to_chars (insn, exp.X_add_number, opformat->oplen);
else
as_bad (_("Invalid .insn format\n"));
@@ -1375,12 +1376,14 @@ s390_insn (ignore)
}
else
as_bad (_("second operand of .insn not a constant\n"));
- if (*input_line_pointer++ != ',')
- as_bad (_("missing comma after insn constant\n"));
+ if (strcmp (opformat->name, "e") != 0 && *input_line_pointer++ != ',')
+ as_bad (_("missing comma after insn constant\n"));
+
if ((s = strchr (input_line_pointer, '\n')) != NULL)
*s = '\0';
- input_line_pointer = md_gather_operands (input_line_pointer, insn, opformat);
+ input_line_pointer = md_gather_operands (input_line_pointer, insn,
+ opformat);
if (s != NULL)
*s = '\n';
demand_empty_rest_of_line ();