diff options
| author | Mike Pall <mike> | 2021-07-19 16:50:05 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2021-07-19 16:50:05 +0200 |
| commit | 21826309035979e17973c5ee2761f430adc6b7a6 (patch) | |
| tree | b2345f3a1ec1e75c3af306e6730a2101961db9d7 /src | |
| parent | 09547f9f6ed8b9d4fc883182d3bb25154c97493a (diff) | |
| download | luajit-21826309035979e17973c5ee2761f430adc6b7a6.tar.gz luajit-21826309035979e17973c5ee2761f430adc6b7a6.tar.bz2 luajit-21826309035979e17973c5ee2761f430adc6b7a6.zip | |
Minor improvements of optimizations.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lj_asm.c | 12 | ||||
| -rw-r--r-- | src/lj_opt_fold.c | 6 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c index fae5b241..b0e6d313 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c | |||
| @@ -2319,13 +2319,23 @@ static void asm_setup_regsp(ASMState *as) | |||
| 2319 | } | 2319 | } |
| 2320 | /* fallthrough */ /* for integer POW */ | 2320 | /* fallthrough */ /* for integer POW */ |
| 2321 | case IR_DIV: case IR_MOD: | 2321 | case IR_DIV: case IR_MOD: |
| 2322 | if (!irt_isnum(ir->t)) { | 2322 | if ((LJ_64 && LJ_SOFTFP) || !irt_isnum(ir->t)) { |
| 2323 | ir->prev = REGSP_HINT(RID_RET); | 2323 | ir->prev = REGSP_HINT(RID_RET); |
| 2324 | if (inloop) | 2324 | if (inloop) |
| 2325 | as->modset |= (RSET_SCRATCH & RSET_GPR); | 2325 | as->modset |= (RSET_SCRATCH & RSET_GPR); |
| 2326 | continue; | 2326 | continue; |
| 2327 | } | 2327 | } |
| 2328 | break; | 2328 | break; |
| 2329 | #if LJ_64 && LJ_SOFTFP | ||
| 2330 | case IR_ADD: case IR_SUB: case IR_MUL: | ||
| 2331 | if (irt_isnum(ir->t)) { | ||
| 2332 | ir->prev = REGSP_HINT(RID_RET); | ||
| 2333 | if (inloop) | ||
| 2334 | as->modset |= (RSET_SCRATCH & RSET_GPR); | ||
| 2335 | continue; | ||
| 2336 | } | ||
| 2337 | break; | ||
| 2338 | #endif | ||
| 2329 | case IR_FPMATH: | 2339 | case IR_FPMATH: |
| 2330 | #if LJ_TARGET_X86ORX64 | 2340 | #if LJ_TARGET_X86ORX64 |
| 2331 | if (ir->op2 <= IRFPM_TRUNC) { | 2341 | if (ir->op2 <= IRFPM_TRUNC) { |
diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c index 4d179f3f..97dad4ff 100644 --- a/src/lj_opt_fold.c +++ b/src/lj_opt_fold.c | |||
| @@ -514,6 +514,7 @@ LJFOLDF(kfold_snew_kptr) | |||
| 514 | } | 514 | } |
| 515 | 515 | ||
| 516 | LJFOLD(SNEW any KINT) | 516 | LJFOLD(SNEW any KINT) |
| 517 | LJFOLD(XSNEW any KINT) | ||
| 517 | LJFOLDF(kfold_snew_empty) | 518 | LJFOLDF(kfold_snew_empty) |
| 518 | { | 519 | { |
| 519 | if (fright->i == 0) | 520 | if (fright->i == 0) |
| @@ -1301,6 +1302,10 @@ LJFOLD(CONV SUB IRCONV_U32_U64) | |||
| 1301 | LJFOLD(CONV MUL IRCONV_U32_U64) | 1302 | LJFOLD(CONV MUL IRCONV_U32_U64) |
| 1302 | LJFOLDF(simplify_conv_narrow) | 1303 | LJFOLDF(simplify_conv_narrow) |
| 1303 | { | 1304 | { |
| 1305 | #if LJ_64 | ||
| 1306 | UNUSED(J); | ||
| 1307 | return NEXTFOLD; | ||
| 1308 | #else | ||
| 1304 | IROp op = (IROp)fleft->o; | 1309 | IROp op = (IROp)fleft->o; |
| 1305 | IRType t = irt_type(fins->t); | 1310 | IRType t = irt_type(fins->t); |
| 1306 | IRRef op1 = fleft->op1, op2 = fleft->op2, mode = fins->op2; | 1311 | IRRef op1 = fleft->op1, op2 = fleft->op2, mode = fins->op2; |
| @@ -1311,6 +1316,7 @@ LJFOLDF(simplify_conv_narrow) | |||
| 1311 | fins->op1 = op1; | 1316 | fins->op1 = op1; |
| 1312 | fins->op2 = op2; | 1317 | fins->op2 = op2; |
| 1313 | return RETRYFOLD; | 1318 | return RETRYFOLD; |
| 1319 | #endif | ||
| 1314 | } | 1320 | } |
| 1315 | 1321 | ||
| 1316 | /* Special CSE rule for CONV. */ | 1322 | /* Special CSE rule for CONV. */ |
