// Before the actual calculation, the state is set to this.
 //
 // regs:
 // %ecx = &expr
 //
 // stack:
 // +-------+
 // | ..... | <- %esp
 // +-------+
 //
 // float stack:
 // +-------+
 // | expr  | <- %st(1)
 // +-------+
 // |  1.0  | <- %st(0)
 // +-------+
 //
 // 1. Compute %st(1) - %st(0) and stores in %st(0).
 //
 // regs:
 // %ecx = &expr
 //
 // stack:
 // +-------+
 // | ..... | <- %esp
 // +-------+
 //
 // float stack:
 // +------------+
 // |    expr    | <- %st(1)
 // +------------+
 // | expr - 1.0 | <- %st(0)
 // +------------+
 //
 // 2. Store %st(0) in memory.
 //
 // regs:
 // %ecx = &expr
 //
 // stack:
 // +-------+
 // | ..... | <- %esp
 // +-------+
 //
 // float stack:
 // +------------+
 // | expr - 1.0 | <- %st(0)
 // +------------+
 //
 public override void CalcAndSaveFloat(CGenState state)
 {
     state.FSUB(1, 0);
     state.FSTS(0, Reg.ECX);
 }
Example #2
0
 public override void CalcAndSaveDouble(CGenState state)
 {
     state.FSUB(1, 0);
     state.FSTL(0, Reg.ECX);
 }
 public override void CalcAndSaveDouble(CGenState state)
 {
     state.FSUB(1, 0);
     state.FSTL(0, Reg.ECX);
 }
Example #4
0
 public override void CalcAndSaveFloat(CGenState state)
 {
     state.FSUB(1, 0);
     state.FSTS(0, Reg.ECX);
 }