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

Method sub

src/hx/cppia/CppiaCompiler.cpp:1267–1295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1265 }
1266
1267 void sub(const JitVal &inDest, const JitVal &v0, const JitVal &v1, bool asFloat ) HXCPP_OVERRIDE
1268 {
1269 sljit_s32 tDest = getTarget(inDest);
1270 sljit_s32 t0 = getTarget(v0);
1271 sljit_s32 t1 = getTarget(v1);
1272 bool isFloat = v0.type==jtFloat;
1273
1274 if (asFloat != isFloat)
1275 {
1276 if (isFloat)
1277 {
1278 emit_fop2(SLJIT_SUB_F64, sJitTempF0, v0, v1 );
1279 convert( sJitTempF0, etFloat, inDest, etInt );
1280 }
1281 else
1282 {
1283 emit_op2(SLJIT_SUB32, sJitTemp0, v0.as(jtInt), v1.as(jtInt) );
1284 convert( sJitTemp0, etInt, inDest, etFloat );
1285 }
1286 }
1287 else
1288 {
1289 if (isFloat)
1290 emit_fop2(SLJIT_SUB_F64, inDest, v0, v1 );
1291 else
1292 emit_op2(SLJIT_SUB32, inDest, v0.as(jtInt), v1.as(jtInt) );
1293 }
1294
1295 }
1296
1297 void fdiv(const JitVal &inDest, const JitVal &v0, const JitVal &v1) HXCPP_OVERRIDE
1298 {

Callers 3

genSetterFunction · 0.45
genCodeMethod · 0.45
genCodeMethod · 0.45

Calls 2

convertFunction · 0.85
asMethod · 0.80

Tested by

no test coverage detected