From 108309a579f6862ee14c083ef4c74332dba99f2e Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Wed, 6 May 2009 19:56:33 +0200 Subject: [PATCH] Ignore short/long prefix of labels instead of ignoring the whole branch instruction! --- gen/asm-x86-32.h | 14 ++++---------- gen/asm-x86-64.h | 16 ++++------------ 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/gen/asm-x86-32.h b/gen/asm-x86-32.h index b2ed99b1..f82ca750 100644 --- a/gen/asm-x86-32.h +++ b/gen/asm-x86-32.h @@ -1419,12 +1419,6 @@ namespace AsmParserx8632 { nextToken(); } - else if ( token->value == TOKint16 || token->value == TOKint32 ) - { - //throw away the 'short' in "jle short label;". Works for 'long' also. - operands[0] = operands[1]; - return; - } else if ( token->value != TOKeof ) { ok = false; @@ -2741,6 +2735,10 @@ namespace AsmParserx8632 Expression * e; Identifier * ident = NULL; + // get rid of short/long prefixes for branches + if (opTakesLabel() && (token->value == TOKint16 || token->value == TOKint64)) + nextToken(); + switch ( token->value ) { case TOKint32v: @@ -2887,10 +2885,6 @@ namespace AsmParserx8632 ident = Id::__dollar; goto do_dollar; break; - case TOKint16: - case TOKint32: - //This if for the 'short' in "jle short Label;" - return Handled; default: if ( op == Op_FMath0 || op == Op_FdST0ST1 || op == Op_FMath ) return Handled; diff --git a/gen/asm-x86-64.h b/gen/asm-x86-64.h index 51f0d8af..a895f261 100644 --- a/gen/asm-x86-64.h +++ b/gen/asm-x86-64.h @@ -1541,12 +1541,6 @@ namespace AsmParserx8664 { nextToken(); } - else if ( token->value == TOKint16 || token->value == TOKint32 || token->value == TOKint64 ) - { - //throw away the 'short' in "jle short Label;". Works for long also. - operands[0] = operands[1]; - return; - } else if ( token->value != TOKeof ) { ok = false; @@ -2864,6 +2858,10 @@ namespace AsmParserx8664 Expression * e; Identifier * ident = NULL; + // get rid of short/long prefixes for branches + if (opTakesLabel() && (token->value == TOKint16 || token->value == TOKint64)) + nextToken(); + switch ( token->value ) { case TOKint32v: @@ -3010,12 +3008,6 @@ namespace AsmParserx8664 ident = Id::__dollar; goto do_dollar; break; - case TOKint16: - case TOKint32: - case TOKint64: - //This is for the 'short' in "jle short Label;" - return Handled; - break; default: if ( op == Op_FMath0 || op == Op_FdST0ST1 || op == Op_FMath ) return Handled;