mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-14 03:43:13 +01:00
Automated merge with http://hg.dsource.org/projects/ldc
This commit is contained in:
@@ -454,7 +454,7 @@ namespace AsmParserx8632
|
||||
/* Op_Fis_P */ { mem, 0, 0, FPInt_Types, Clb_ST }, // push and pop, fild so also 64 bit
|
||||
/* Op_Fid */ { D|mem, 0, 0, FPInt_Types }, // only 16bit and 32bit, DMD defaults to 16bit
|
||||
/* Op_Fid_P */ { D|mem, 0, 0, FPInt_Types, Clb_ST, Next_Form, Op_FidR_P }, // push and pop, fild so also 64 bit
|
||||
/* Op_FidR_P */ { D|mem,rfp, 0, 0, Clb_ST }, // push and pop, fild so also 64 bit
|
||||
/* Op_FidR_P */ { D|mem,rfp, 0, FPInt_Types, Clb_ST }, // push and pop, fild so also 64 bit
|
||||
/* Op_Ffd */ { D|mfp, 0, 0, FP_Types, 0, Next_Form, Op_FfdR }, // only 16bit and 32bit, DMD defaults to 16bit, reg form doesn't need type
|
||||
/* Op_FfdR */ { D|rfp, 0, 0 },
|
||||
/* Op_Ffd_P */ { D|mfp, 0, 0, FP_Types, Clb_ST, Next_Form, Op_FfdR_P }, // pop, fld so also 80 bit, "
|
||||
@@ -1723,6 +1723,16 @@ namespace AsmParserx8632
|
||||
else
|
||||
mnemonic = opIdent->string;
|
||||
|
||||
// handle two-operand form where second arg is ignored.
|
||||
// must be done before type_char detection
|
||||
if ( op == Op_FidR_P || op == Op_fxch || op == Op_FfdRR_P )
|
||||
{
|
||||
if (operands[1].cls == Opr_Reg && operands[1].reg == Reg_ST )
|
||||
nOperands = 1;
|
||||
else
|
||||
stmt->error("instruction allows only ST as second argument");
|
||||
}
|
||||
|
||||
if ( opInfo->needsType )
|
||||
{
|
||||
PtrType exact_type = Default_Ptr;
|
||||
@@ -1787,31 +1797,6 @@ namespace AsmParserx8632
|
||||
if ( operands[0].dataSize == Far_Ptr ) // %% type=Far_Ptr not set by Seg:Ofss OTOH, we don't support that..
|
||||
insnTemplate << 'l';
|
||||
}
|
||||
else if ( op == Op_fxch || op == Op_FfdRR_P || op == Op_FidR_P )
|
||||
{
|
||||
if ( operands[0].cls == Opr_Mem && op == Op_FidR_P )
|
||||
{
|
||||
nOperands = 1;
|
||||
}
|
||||
// gas won't accept the two-operand form
|
||||
else if ( operands[1].cls == Opr_Reg && operands[1].reg == Reg_ST )
|
||||
{
|
||||
nOperands = 1;
|
||||
}
|
||||
else if ( operands[1].cls == Opr_Mem && operands[1].reg == Reg_ST || operands[0].cls == Opr_Mem )
|
||||
{
|
||||
nOperands = 1;
|
||||
}
|
||||
else if ( operands[0].cls == Opr_Reg && (operands[0].reg == Reg_ST || operands[0].reg == Reg_ST1 ))
|
||||
{
|
||||
//fix previous update to allow single operand form of fstp
|
||||
}
|
||||
else
|
||||
{
|
||||
stmt->error ( "invalid operands" );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if ( op == Op_FMath0 || op == Op_FdST0ST1 )
|
||||
{
|
||||
operands[0].cls = Opr_Reg;
|
||||
|
||||
@@ -1849,6 +1849,16 @@ namespace AsmParserx8664
|
||||
else
|
||||
mnemonic = opIdent->string;
|
||||
|
||||
// handle two-operand form where second arg is ignored.
|
||||
// must be done before type_char detection
|
||||
if ( op == Op_FidR_P || op == Op_fxch || op == Op_FfdRR_P )
|
||||
{
|
||||
if (operands[1].cls == Opr_Reg && operands[1].reg == Reg_ST )
|
||||
nOperands = 1;
|
||||
else
|
||||
stmt->error("instruction allows only ST as second argument");
|
||||
}
|
||||
|
||||
if ( opInfo->needsType )
|
||||
{
|
||||
PtrType exact_type = Default_Ptr;
|
||||
@@ -1913,27 +1923,6 @@ namespace AsmParserx8664
|
||||
if ( operands[0].dataSize == Far_Ptr ) // %% type=Far_Ptr not set by Seg:Ofss OTOH, we don't support that..
|
||||
insnTemplate << 'l';
|
||||
}
|
||||
else if ( op == Op_fxch || op == Op_FfdRR_P || op == Op_FidR_P )
|
||||
{
|
||||
if ( operands[0].cls == Opr_Mem && op == Op_FidR_P )
|
||||
{
|
||||
nOperands = 1;
|
||||
}
|
||||
// gas won't accept the two-operand form
|
||||
else if ( operands[1].cls == Opr_Reg && operands[1].reg == Reg_ST )
|
||||
{
|
||||
nOperands = 1;
|
||||
}
|
||||
else if ( operands[0].cls == Opr_Reg && (operands[0].reg == Reg_ST1 || operands[0].reg == Reg_ST ))
|
||||
{
|
||||
//fix previous update to allow single operand form of fstp
|
||||
}
|
||||
else
|
||||
{
|
||||
stmt->error ( "invalid operands" );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if ( op == Op_FMath0 || op == Op_FdST0ST1 )
|
||||
{
|
||||
operands[0].cls = Opr_Reg;
|
||||
|
||||
Reference in New Issue
Block a user