Mercurial > projects > ldc
diff gen/asm-x86-64.h @ 1101:8bf8b058944a
Clean up asm code a bit.
- Use vector instead of Array, reducing allocations.
- Use vectors instead of deques since we only push_back and index.
- Remove redundant typedefs of iterators.
- Comment out unused variable (used only in commented-out GDC code).
- A few whitespace changes.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Thu, 12 Mar 2009 14:08:57 +0100 |
parents | b3a0cf072ed0 |
children | ae950bd712d3 |
line wrap: on
line diff
--- a/gen/asm-x86-64.h Thu Mar 12 14:08:57 2009 +0100 +++ b/gen/asm-x86-64.h Thu Mar 12 14:08:57 2009 +0100 @@ -533,12 +533,12 @@ /* 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, " /* Op_FfdR_P */ { D|rfp, 0, 0, 0, Clb_ST, Next_Form, Op_FfdRR_P }, - /* Op_FfdRR_P */ { D|mfp|rfp,rfp,0, 0, Clb_ST }, + /* Op_FfdRR_P */ { D|mfp|rfp,rfp,0, 0, Clb_ST }, /* Op_Fd_P */ { D|mem, 0, 0, 0, Clb_ST }, // " /* Op_FdST */ { D|rfp, 0, 0 }, /* Op_FMath */ { mfp, 0, 0, FP_Types, Clb_ST, Next_Form, Op_FMath0 }, // and only single or double prec /* Op_FMath0 */ { 0, 0, 0, 0, Clb_ST, Next_Form, Op_FMath2 }, // pops - /* Op_FMath2 */ { D|rfp, rfp, 0, 0, Clb_ST, Next_Form, Op_FdST0ST1 }, // and only single or double prec + /* Op_FMath2 */ { D|rfp, rfp, 0, 0, Clb_ST, Next_Form, Op_FdST0ST1 }, // and only single or double prec /* Op_FdSTiSTi */ { D|rfp, rfp, 0, }, /* Op_FdST0ST1 */ { 0, 0, 0, }, /* Op_FPMath */ { D|rfp, rfp, 0, 0, Clb_ST, Next_Form, Op_F0_P }, // pops @@ -1677,17 +1677,17 @@ else { insnTemplate->writestring ( ( char* ) fmt ); - insnTemplate->printf ( "<<%s%d>>", ( mode==Mode_Input ) ?"in":"out", asmcode->args.dim ); - asmcode->args.push ( new AsmArg ( type, e, mode ) ); + insnTemplate->printf ( "<<%s%d>>", ( mode==Mode_Input ) ?"in":"out", asmcode->args.size() ); + asmcode->args.push_back ( AsmArg ( type, e, mode ) ); } } void addOperand2 ( const char * fmtpre, const char * fmtpost, AsmArgType type, Expression * e, AsmCode * asmcode, AsmArgMode mode = Mode_Input ) { assert ( !sc->func->naked ); insnTemplate->writestring ( ( char* ) fmtpre ); - insnTemplate->printf ( "<<%s%d>>", ( mode==Mode_Input ) ?"in":"out", asmcode->args.dim ); + insnTemplate->printf ( "<<%s%d>>", ( mode==Mode_Input ) ?"in":"out", asmcode->args.size() ); insnTemplate->writestring ( ( char* ) fmtpost ); - asmcode->args.push ( new AsmArg ( type, e, mode ) ); + asmcode->args.push_back ( AsmArg ( type, e, mode ) ); } void addLabel ( char* id )