This commit is contained in:
Frits van Bommel
2009-05-06 20:29:27 +02:00
2 changed files with 66 additions and 28 deletions

View File

@@ -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;
@@ -1885,11 +1879,37 @@ namespace AsmParserx8632
insnTemplate.write(mnemonic, mlen-1) << tc_1 << type_char;
}
break;
case Op_FMath0:
// the no-operand versions of floating point ops always pop
insnTemplate << mnemonic << "p";
break;
default:
// special case fdiv, fsub: see dmd 840, ldc 256
if (strncmp(mnemonic, "fsub", 4) == 0 ||
strncmp(mnemonic, "fdiv", 4) == 0)
{
// replace:
// f{sub,div}r{p,} <-> f{sub,div}{p,}
if (mnemonic[4] == 'r')
{
insnTemplate.write(mnemonic, 4);
insnTemplate.write(mnemonic+5, strlen(mnemonic)-5);
}
else
{
insnTemplate.write(mnemonic, 4) << "r";
insnTemplate.write(mnemonic+4, strlen(mnemonic)-4);
}
}
else
{
insnTemplate << mnemonic;
if ( type_char )
insnTemplate << type_char;
break;
}
if ( type_char )
insnTemplate << type_char;
break;
}
switch ( opInfo->implicitClobbers & Clb_DXAX_Mask )
@@ -2715,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:
@@ -2861,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;

View File

@@ -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;
@@ -2007,11 +2001,37 @@ namespace AsmParserx8664
insnTemplate.write(mnemonic, mlen-1) << tc_1 << type_char;
}
break;
case Op_FMath0:
// the no-operand versions of floating point ops always pop
insnTemplate << mnemonic << "p";
break;
default:
// special case fdiv, fsub: see dmd 840, ldc 256
if (strncmp(mnemonic, "fsub", 4) == 0 ||
strncmp(mnemonic, "fdiv", 4) == 0)
{
// replace:
// f{sub,div}r{p,} <-> f{sub,div}{p,}
if (mnemonic[4] == 'r')
{
insnTemplate.write(mnemonic, 4);
insnTemplate.write(mnemonic+5, strlen(mnemonic)-5);
}
else
{
insnTemplate.write(mnemonic, 4) << "r";
insnTemplate.write(mnemonic+4, strlen(mnemonic)-4);
}
}
else
{
insnTemplate << mnemonic;
if ( type_char )
insnTemplate << type_char;
break;
}
if ( type_char )
insnTemplate << type_char;
break;
}
switch ( opInfo->implicitClobbers & Clb_DXAX_Mask )
@@ -2838,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:
@@ -2984,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;