# HG changeset patch # User Kelly Wilson # Date 1236707990 14400 # Node ID b1d75bf46ffa87e9f238ec55d811ab80add0f696 # Parent 56e364ba346cf2e797c0e7d1b65fd0912165a731 fix fistp properly for x32 diff -r 56e364ba346c -r b1d75bf46ffa gen/asm-x86-32.h --- a/gen/asm-x86-32.h Tue Mar 10 11:08:35 2009 -0600 +++ b/gen/asm-x86-32.h Tue Mar 10 13:59:50 2009 -0400 @@ -209,6 +209,7 @@ Op_Fis_P, Op_Fid, Op_Fid_P, + Op_FidR_P, Op_Ffd, Op_FfdR, Op_Ffd_P, @@ -449,7 +450,8 @@ /* Op_Fis_ST */ { mem, 0, 0, FPInt_Types, Clb_ST }, // " /* 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, Op_FfdRR_P }, // push and pop, fild so also 64 bit + /* 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, 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, " @@ -1757,13 +1759,25 @@ if ( operands[0].dataSize == Far_Ptr ) // %% type=Far_Ptr not set by Seg:Ofss OTOH, we don't support that.. insnTemplate->writebyte ( 'l' ); } - else if ( op == Op_fxch || op == Op_FfdRR_P) + 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 - if ( operands[1].cls == Opr_Reg && operands[1].reg == Reg_ST ) + 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" );