Skip to content
Permalink
Browse files
LLint should be able to use x87 instead of SSE for floating pointer
https://bugs.webkit.org/show_bug.cgi?id=112239

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Implements LLInt floating point operations in x87, to ensure we support
x86 without SSE2.

X86 (except 64bit) now defaults to using x87 instructions in order to
support all 32bit x86 back to i686. The implementation uses the fucomi
instruction from i686 which sets the new minimum.

The FPU registers must always be empty on entering or exiting a function.
We make sure to only use two X87 registers, and they are always emptied
before calling deeper functions or returning from the LLInt.

* jit/JITStubs.cpp:
(JSC): Empty FPU registers before exiting.
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* offlineasm/instructions.rb:
* offlineasm/x86.rb:

Source/WTF:

Disable GTK workaround now that LLInt does not require SSE2.

* wtf/Platform.h:


Canonical link: https://commits.webkit.org/133300@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carewolf committed Apr 20, 2013
1 parent fdd2d2a commit aa0ea4c6270fbdaaa1d2f192e0368ab235bdc3f6
@@ -1,3 +1,28 @@
2013-04-20 Allan Sandfeld Jensen <allan.jensen@digia.com>

LLint should be able to use x87 instead of SSE for floating pointer
https://bugs.webkit.org/show_bug.cgi?id=112239

Reviewed by Filip Pizlo.

Implements LLInt floating point operations in x87, to ensure we support
x86 without SSE2.

X86 (except 64bit) now defaults to using x87 instructions in order to
support all 32bit x86 back to i686. The implementation uses the fucomi
instruction from i686 which sets the new minimum.

The FPU registers must always be empty on entering or exiting a function.
We make sure to only use two X87 registers, and they are always emptied
before calling deeper functions or returning from the LLInt.

* jit/JITStubs.cpp:
(JSC): Empty FPU registers before exiting.
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* offlineasm/instructions.rb:
* offlineasm/x86.rb:

2013-04-19 Roger Fong <roger_fong@apple.com>

Remove uses of WebKit_Source from AppleWin build in JavaScriptCore.
@@ -99,13 +99,17 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n"
"pushl %edi" "\n"
"pushl %ebx" "\n"
"subl $0x3c, %esp" "\n"
"movw $0x02FF, %bx" "\n"
"movw %bx, 0(%esp)" "\n"
"fldcw 0(%esp)" "\n"
"movl 0x58(%esp), %edi" "\n"
"call *0x50(%esp)" "\n"
"addl $0x3c, %esp" "\n"
"popl %ebx" "\n"
"popl %edi" "\n"
"popl %esi" "\n"
"popl %ebp" "\n"
"ffree %st(1)" "\n"
"ret" "\n"
".globl " SYMBOL_STRING(ctiTrampolineEnd) "\n"
HIDE_SYMBOL(ctiTrampolineEnd) "\n"
@@ -110,6 +110,7 @@ macro cCall2(function, arg1, arg2)
move arg2, t1
call function
elsif X86
resetX87Stack
poke arg1, 0
poke arg2, 1
call function
@@ -133,6 +134,7 @@ macro cCall4(function, arg1, arg2, arg3, arg4)
move arg4, t3
call function
elsif X86
resetX87Stack
poke arg1, 0
poke arg2, 1
poke arg3, 2
@@ -88,6 +88,9 @@ end
macro prepareStateForCCall()
leap [PB, PC, 8], PC
move PB, t3
if X86_64
resetX87Stack
end
end

macro restoreStateAfterCCall()
@@ -254,7 +254,8 @@
X86_INSTRUCTIONS =
[
"cdqi",
"idivi"
"idivi",
"resetX87Stack"
]

ARM_INSTRUCTIONS =

0 comments on commit aa0ea4c

Please sign in to comment.