MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / genCode

Method genCode

src/hx/cppia/Cppia.cpp:6802–6837  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6800 }
6801 #ifdef CPPIA_JIT
6802 void genCode(CppiaCompiler *compiler, const JitVal &inDest, ExprType destType) HXCPP_OVERRIDE
6803 {
6804 if (destType==etVoid)
6805 {
6806 left->genCode(compiler,JitVal(),etVoid);
6807 right->genCode(compiler,JitVal(),etVoid);
6808 }
6809 else if (destType==etInt || (left->getType()==etInt && right->getType()==etInt) )
6810 {
6811 JitTemp lval(compiler,jtInt);
6812 left->genCode(compiler,lval,etInt);
6813 right->genCode(compiler,sJitTemp0.as(jtInt),etInt);
6814 if (destType==etInt)
6815 {
6816 compiler->sub(inDest.as(jtInt),lval,sJitTemp0,false);
6817 }
6818 else
6819 {
6820 compiler->sub(sJitTemp1.as(jtInt),lval,sJitTemp0,false);
6821 compiler->convert(sJitTemp1,etInt, inDest, destType);
6822 }
6823 }
6824 else
6825 {
6826 JitTemp lval(compiler,jtFloat);
6827 left->genCode(compiler,lval,etFloat);
6828 right->genCode(compiler,sJitTempF0,etFloat);
6829 if (destType==etFloat)
6830 compiler->sub(inDest.as(jtFloat),lval,sJitTempF0,true);
6831 else
6832 {
6833 compiler->sub(sJitTempF1,lval,sJitTempF0,true);
6834 compiler->convert(sJitTempF1,etFloat, inDest, destType);
6835 }
6836 }
6837 }
6838 #endif
6839
6840};

Callers

nothing calls this directly

Calls 6

JitValClass · 0.85
asMethod · 0.80
convertMethod · 0.80
genCodeMethod · 0.45
getTypeMethod · 0.45
subMethod · 0.45

Tested by

no test coverage detected