From 32cd4c2a62f34815dbc9c13e1e6640bb096d05b5 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 4 Apr 2008 13:34:53 -0700 Subject: Correctly identify SBYTE in the optimizer Correctly identify SBYTE in the optimizer, *HOWEVER*, this change will cause nuisance warnings to be issued; that will have to be fixed. --- parser.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'parser.c') 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 */ -- cgit v1.2.3