diff options
| author | Mike Pall <mike> | 2022-07-08 15:12:43 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2022-07-08 15:12:43 +0200 |
| commit | e3bae12fc0461cfa7e4bef3dfed2dad372e5da8d (patch) | |
| tree | 0172732629c000567a6f68178b5132a1a551ec07 /src | |
| parent | 4c2441c16ce3c4e312aaefecc6d40c4fe21de97c (diff) | |
| parent | 674afcd4e21d0cf64de3219d347557a0aed8ecc7 (diff) | |
| download | luajit-e3bae12fc0461cfa7e4bef3dfed2dad372e5da8d.tar.gz luajit-e3bae12fc0461cfa7e4bef3dfed2dad372e5da8d.tar.bz2 luajit-e3bae12fc0461cfa7e4bef3dfed2dad372e5da8d.zip | |
Merge branch 'master' into v2.1
Diffstat (limited to 'src')
| -rw-r--r-- | src/vm_x64.dasc | 13 | ||||
| -rw-r--r-- | src/vm_x86.dasc | 13 |
2 files changed, 12 insertions, 14 deletions
diff --git a/src/vm_x64.dasc b/src/vm_x64.dasc index 8dd48b84..03d96557 100644 --- a/src/vm_x64.dasc +++ b/src/vm_x64.dasc | |||
| @@ -359,9 +359,6 @@ | |||
| 359 | |.macro sseconst_1, reg, tmp // Synthesize 1.0. | 359 | |.macro sseconst_1, reg, tmp // Synthesize 1.0. |
| 360 | | sseconst_hi reg, tmp, 3ff00000 | 360 | | sseconst_hi reg, tmp, 3ff00000 |
| 361 | |.endmacro | 361 | |.endmacro |
| 362 | |.macro sseconst_m1, reg, tmp // Synthesize -1.0. | ||
| 363 | | sseconst_hi reg, tmp, bff00000 | ||
| 364 | |.endmacro | ||
| 365 | |.macro sseconst_2p52, reg, tmp // Synthesize 2^52. | 362 | |.macro sseconst_2p52, reg, tmp // Synthesize 2^52. |
| 366 | | sseconst_hi reg, tmp, 43300000 | 363 | | sseconst_hi reg, tmp, 43300000 |
| 367 | |.endmacro | 364 | |.endmacro |
| @@ -2530,15 +2527,17 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2530 | | addsd xmm1, xmm3 // (|x| + 2^52) - 2^52 | 2527 | | addsd xmm1, xmm3 // (|x| + 2^52) - 2^52 |
| 2531 | | subsd xmm1, xmm3 | 2528 | | subsd xmm1, xmm3 |
| 2532 | | orpd xmm1, xmm2 // Merge sign bit back in. | 2529 | | orpd xmm1, xmm2 // Merge sign bit back in. |
| 2530 | | sseconst_1 xmm3, RD | ||
| 2533 | | .if mode == 1 // ceil(x)? | 2531 | | .if mode == 1 // ceil(x)? |
| 2534 | | sseconst_m1 xmm2, RD // Must subtract -1 to preserve -0. | ||
| 2535 | | cmpsd xmm0, xmm1, 6 // x > result? | 2532 | | cmpsd xmm0, xmm1, 6 // x > result? |
| 2533 | | andpd xmm0, xmm3 | ||
| 2534 | | addsd xmm1, xmm0 // If yes, add 1. | ||
| 2535 | | orpd xmm1, xmm2 // Merge sign bit back in (again). | ||
| 2536 | | .else // floor(x)? | 2536 | | .else // floor(x)? |
| 2537 | | sseconst_1 xmm2, RD | ||
| 2538 | | cmpsd xmm0, xmm1, 1 // x < result? | 2537 | | cmpsd xmm0, xmm1, 1 // x < result? |
| 2538 | | andpd xmm0, xmm3 | ||
| 2539 | | subsd xmm1, xmm0 // If yes, subtract 1. | ||
| 2539 | | .endif | 2540 | | .endif |
| 2540 | | andpd xmm0, xmm2 | ||
| 2541 | | subsd xmm1, xmm0 // If yes, subtract +-1. | ||
| 2542 | |.endif | 2541 | |.endif |
| 2543 | | movaps xmm0, xmm1 | 2542 | | movaps xmm0, xmm1 |
| 2544 | |1: | 2543 | |1: |
diff --git a/src/vm_x86.dasc b/src/vm_x86.dasc index de12ac64..18ca87b5 100644 --- a/src/vm_x86.dasc +++ b/src/vm_x86.dasc | |||
| @@ -464,9 +464,6 @@ | |||
| 464 | |.macro sseconst_1, reg, tmp // Synthesize 1.0. | 464 | |.macro sseconst_1, reg, tmp // Synthesize 1.0. |
| 465 | | sseconst_hi reg, tmp, 3ff00000 | 465 | | sseconst_hi reg, tmp, 3ff00000 |
| 466 | |.endmacro | 466 | |.endmacro |
| 467 | |.macro sseconst_m1, reg, tmp // Synthesize -1.0. | ||
| 468 | | sseconst_hi reg, tmp, bff00000 | ||
| 469 | |.endmacro | ||
| 470 | |.macro sseconst_2p52, reg, tmp // Synthesize 2^52. | 467 | |.macro sseconst_2p52, reg, tmp // Synthesize 2^52. |
| 471 | | sseconst_hi reg, tmp, 43300000 | 468 | | sseconst_hi reg, tmp, 43300000 |
| 472 | |.endmacro | 469 | |.endmacro |
| @@ -2989,15 +2986,17 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2989 | | addsd xmm1, xmm3 // (|x| + 2^52) - 2^52 | 2986 | | addsd xmm1, xmm3 // (|x| + 2^52) - 2^52 |
| 2990 | | subsd xmm1, xmm3 | 2987 | | subsd xmm1, xmm3 |
| 2991 | | orpd xmm1, xmm2 // Merge sign bit back in. | 2988 | | orpd xmm1, xmm2 // Merge sign bit back in. |
| 2989 | | sseconst_1 xmm3, RDa | ||
| 2992 | | .if mode == 1 // ceil(x)? | 2990 | | .if mode == 1 // ceil(x)? |
| 2993 | | sseconst_m1 xmm2, RDa // Must subtract -1 to preserve -0. | ||
| 2994 | | cmpsd xmm0, xmm1, 6 // x > result? | 2991 | | cmpsd xmm0, xmm1, 6 // x > result? |
| 2992 | | andpd xmm0, xmm3 | ||
| 2993 | | addsd xmm1, xmm0 // If yes, add 1. | ||
| 2994 | | orpd xmm1, xmm2 // Merge sign bit back in (again). | ||
| 2995 | | .else // floor(x)? | 2995 | | .else // floor(x)? |
| 2996 | | sseconst_1 xmm2, RDa | ||
| 2997 | | cmpsd xmm0, xmm1, 1 // x < result? | 2996 | | cmpsd xmm0, xmm1, 1 // x < result? |
| 2997 | | andpd xmm0, xmm3 | ||
| 2998 | | subsd xmm1, xmm0 // If yes, subtract 1. | ||
| 2998 | | .endif | 2999 | | .endif |
| 2999 | | andpd xmm0, xmm2 | ||
| 3000 | | subsd xmm1, xmm0 // If yes, subtract +-1. | ||
| 3001 | |.endif | 3000 | |.endif |
| 3002 | | movaps xmm0, xmm1 | 3001 | | movaps xmm0, xmm1 |
| 3003 | |1: | 3002 | |1: |
