summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/parser.c b/parser.c
index 5983af5..9172fb1 100644
--- a/parser.c
+++ b/parser.c
@@ -797,9 +797,16 @@ restart_parse:
result->oprs[operand].type |= UNITY;
if (optimizing >= 0 &&
!(result->oprs[operand].type & STRICT)) {
- if (reloc_value(value) >= -128 &&
- reloc_value(value) <= 127)
- result->oprs[operand].type |= SBYTE;
+ int64_t v64 = reloc_value(value);
+ int32_t v32 = (int32_t)v64;
+ int16_t v16 = (int16_t)v32;
+
+ if (v64 >= -128 && v64 <= 127)
+ result->oprs[operand].type |= SBYTE64;
+ if (v32 >= -128 && v32 <= 127)
+ result->oprs[operand].type |= SBYTE32;
+ if (v16 >= -128 && v16 <= 127)
+ result->oprs[operand].type |= SBYTE16;
}
}
} else { /* it's a register */