mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Merge branch 'master' into v2.1
This commit is contained in:
commit
e3bae12fc0
@ -359,9 +359,6 @@
|
|||||||
|.macro sseconst_1, reg, tmp // Synthesize 1.0.
|
|.macro sseconst_1, reg, tmp // Synthesize 1.0.
|
||||||
| sseconst_hi reg, tmp, 3ff00000
|
| sseconst_hi reg, tmp, 3ff00000
|
||||||
|.endmacro
|
|.endmacro
|
||||||
|.macro sseconst_m1, reg, tmp // Synthesize -1.0.
|
|
||||||
| sseconst_hi reg, tmp, bff00000
|
|
||||||
|.endmacro
|
|
||||||
|.macro sseconst_2p52, reg, tmp // Synthesize 2^52.
|
|.macro sseconst_2p52, reg, tmp // Synthesize 2^52.
|
||||||
| sseconst_hi reg, tmp, 43300000
|
| sseconst_hi reg, tmp, 43300000
|
||||||
|.endmacro
|
|.endmacro
|
||||||
@ -2530,15 +2527,17 @@ static void build_subroutines(BuildCtx *ctx)
|
|||||||
| addsd xmm1, xmm3 // (|x| + 2^52) - 2^52
|
| addsd xmm1, xmm3 // (|x| + 2^52) - 2^52
|
||||||
| subsd xmm1, xmm3
|
| subsd xmm1, xmm3
|
||||||
| orpd xmm1, xmm2 // Merge sign bit back in.
|
| orpd xmm1, xmm2 // Merge sign bit back in.
|
||||||
|
| sseconst_1 xmm3, RD
|
||||||
| .if mode == 1 // ceil(x)?
|
| .if mode == 1 // ceil(x)?
|
||||||
| sseconst_m1 xmm2, RD // Must subtract -1 to preserve -0.
|
|
||||||
| cmpsd xmm0, xmm1, 6 // x > result?
|
| cmpsd xmm0, xmm1, 6 // x > result?
|
||||||
|
| andpd xmm0, xmm3
|
||||||
|
| addsd xmm1, xmm0 // If yes, add 1.
|
||||||
|
| orpd xmm1, xmm2 // Merge sign bit back in (again).
|
||||||
| .else // floor(x)?
|
| .else // floor(x)?
|
||||||
| sseconst_1 xmm2, RD
|
|
||||||
| cmpsd xmm0, xmm1, 1 // x < result?
|
| cmpsd xmm0, xmm1, 1 // x < result?
|
||||||
|
| andpd xmm0, xmm3
|
||||||
|
| subsd xmm1, xmm0 // If yes, subtract 1.
|
||||||
| .endif
|
| .endif
|
||||||
| andpd xmm0, xmm2
|
|
||||||
| subsd xmm1, xmm0 // If yes, subtract +-1.
|
|
||||||
|.endif
|
|.endif
|
||||||
| movaps xmm0, xmm1
|
| movaps xmm0, xmm1
|
||||||
|1:
|
|1:
|
||||||
|
@ -464,9 +464,6 @@
|
|||||||
|.macro sseconst_1, reg, tmp // Synthesize 1.0.
|
|.macro sseconst_1, reg, tmp // Synthesize 1.0.
|
||||||
| sseconst_hi reg, tmp, 3ff00000
|
| sseconst_hi reg, tmp, 3ff00000
|
||||||
|.endmacro
|
|.endmacro
|
||||||
|.macro sseconst_m1, reg, tmp // Synthesize -1.0.
|
|
||||||
| sseconst_hi reg, tmp, bff00000
|
|
||||||
|.endmacro
|
|
||||||
|.macro sseconst_2p52, reg, tmp // Synthesize 2^52.
|
|.macro sseconst_2p52, reg, tmp // Synthesize 2^52.
|
||||||
| sseconst_hi reg, tmp, 43300000
|
| sseconst_hi reg, tmp, 43300000
|
||||||
|.endmacro
|
|.endmacro
|
||||||
@ -2989,15 +2986,17 @@ static void build_subroutines(BuildCtx *ctx)
|
|||||||
| addsd xmm1, xmm3 // (|x| + 2^52) - 2^52
|
| addsd xmm1, xmm3 // (|x| + 2^52) - 2^52
|
||||||
| subsd xmm1, xmm3
|
| subsd xmm1, xmm3
|
||||||
| orpd xmm1, xmm2 // Merge sign bit back in.
|
| orpd xmm1, xmm2 // Merge sign bit back in.
|
||||||
|
| sseconst_1 xmm3, RDa
|
||||||
| .if mode == 1 // ceil(x)?
|
| .if mode == 1 // ceil(x)?
|
||||||
| sseconst_m1 xmm2, RDa // Must subtract -1 to preserve -0.
|
|
||||||
| cmpsd xmm0, xmm1, 6 // x > result?
|
| cmpsd xmm0, xmm1, 6 // x > result?
|
||||||
|
| andpd xmm0, xmm3
|
||||||
|
| addsd xmm1, xmm0 // If yes, add 1.
|
||||||
|
| orpd xmm1, xmm2 // Merge sign bit back in (again).
|
||||||
| .else // floor(x)?
|
| .else // floor(x)?
|
||||||
| sseconst_1 xmm2, RDa
|
|
||||||
| cmpsd xmm0, xmm1, 1 // x < result?
|
| cmpsd xmm0, xmm1, 1 // x < result?
|
||||||
|
| andpd xmm0, xmm3
|
||||||
|
| subsd xmm1, xmm0 // If yes, subtract 1.
|
||||||
| .endif
|
| .endif
|
||||||
| andpd xmm0, xmm2
|
|
||||||
| subsd xmm1, xmm0 // If yes, subtract +-1.
|
|
||||||
|.endif
|
|.endif
|
||||||
| movaps xmm0, xmm1
|
| movaps xmm0, xmm1
|
||||||
|1:
|
|1:
|
||||||
|
Loading…
Reference in New Issue
Block a user