]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - offlineasm/instructions.rb
JavaScriptCore-1218.33.tar.gz
[apple/javascriptcore.git] / offlineasm / instructions.rb
index 67cec6d96599c3ff0ff2c7b0f4013d6a6e4c8bac..10647bdf5de13c9993454b13271e298d4e86daa8 100644 (file)
@@ -21,6 +21,8 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 # THE POSSIBILITY OF SUCH DAMAGE.
 
+require "config"
+
 # Interesting invariant, which we take advantage of: branching instructions
 # always begin with "b", and no non-branching instructions begin with "b".
 # Terminal instructions are "jmp" and "ret".
@@ -31,15 +33,19 @@ MACRO_INSTRUCTIONS =
      "andi",
      "lshifti",
      "lshiftp",
+     "lshiftq",
      "muli",
      "negi",
      "negp",
+     "negq",
      "noti",
      "ori",
      "rshifti",
      "urshifti",
      "rshiftp",
      "urshiftp",
+     "rshiftq",
+     "urshiftq",
      "subi",
      "xori",
      "loadi",
@@ -61,8 +67,8 @@ MACRO_INSTRUCTIONS =
      "ci2d",
      "fii2d", # usage: fii2d <gpr with least significant bits>, <gpr with most significant bits>, <fpr>
      "fd2ii", # usage: fd2ii <fpr>, <gpr with least significant bits>, <gpr with most significant bits>
-     "fp2d",
-     "fd2p",
+     "fq2d",
+     "fd2q",
      "bdeq",
      "bdneq",
      "bdgt",
@@ -82,8 +88,8 @@ MACRO_INSTRUCTIONS =
      "pop",
      "push",
      "move",
-     "sxi2p",
-     "zxi2p",
+     "sxi2q",
+     "zxi2q",
      "nop",
      "bieq",
      "bineq",
@@ -105,11 +111,9 @@ MACRO_INSTRUCTIONS =
      "bbgteq",
      "bblt",
      "bblteq",
-     "btio",
      "btis",
      "btiz",
      "btinz",
-     "btbo",
      "btbs",
      "btbz",
      "btbnz",
@@ -153,15 +157,12 @@ MACRO_INSTRUCTIONS =
      "cigteq",
      "cilt",
      "cilteq",
-     "tio",
      "tis",
      "tiz",
      "tinz",
-     "tbo",
      "tbs",
      "tbz",
      "tbnz",
-     "tpo",
      "tps",
      "tpz",
      "tpnz",
@@ -195,7 +196,6 @@ MACRO_INSTRUCTIONS =
      "cplt",
      "cplteq",
      "storep",
-     "btpo",
      "btps",
      "btpz",
      "btpnz",
@@ -203,6 +203,46 @@ MACRO_INSTRUCTIONS =
      "baddps",
      "baddpz",
      "baddpnz",
+     "tqs",
+     "tqz",
+     "tqnz",
+     "peekq",
+     "pokeq",
+     "bqeq",
+     "bqneq",
+     "bqa",
+     "bqaeq",
+     "bqb",
+     "bqbeq",
+     "bqgt",
+     "bqgteq",
+     "bqlt",
+     "bqlteq",
+     "addq",
+     "mulq",
+     "andq",
+     "orq",
+     "subq",
+     "xorq",
+     "loadq",
+     "cqeq",
+     "cqneq",
+     "cqa",
+     "cqaeq",
+     "cqb",
+     "cqbeq",
+     "cqgt",
+     "cqgteq",
+     "cqlt",
+     "cqlteq",
+     "storeq",
+     "btqs",
+     "btqz",
+     "btqnz",
+     "baddqo",
+     "baddqs",
+     "baddqz",
+     "baddqnz",
      "bo",
      "bs",
      "bz",
@@ -214,18 +254,61 @@ MACRO_INSTRUCTIONS =
 X86_INSTRUCTIONS =
     [
      "cdqi",
-     "idivi"
+     "idivi",
+     "resetX87Stack"
+    ]
+
+RISC_INSTRUCTIONS =
+    [
+     "smulli",  # Multiply two 32-bit words and produce a 64-bit word
+     "addis",   # Add integers and set a flag.
+     "subis",   # Same, but for subtraction.
+     "oris",    # Same, but for bitwise or.
+     "addps"    # addis but for pointers.
     ]
 
-ARMv7_INSTRUCTIONS =
+MIPS_INSTRUCTIONS =
     [
-     "smulli",
-     "addis",
-     "subis",
-     "oris"
+    "movz",
+    "movn",
+    "slt",
+    "sltu",
+    "pichdr",
+    "pichdrra"
+    ]
+
+SH4_INSTRUCTIONS =
+    [
+    "shllx",
+    "shlrx",
+    "shld",
+    "shad",
+    "bdnan",
+    "loaddReversedAndIncrementAddress",
+    "storedReversedAndDecrementAddress",
+    "ldspr",
+    "stspr",
+    "callf",
+    "jmpf"
+    ]
+
+CXX_INSTRUCTIONS =
+    [
+     "cloopCrash",           # no operands
+     "cloopCallJSFunction",  # operands: callee
+     "cloopCallNative",      # operands: callee
+     "cloopCallSlowPath",    # operands: callTarget, currentFrame, currentPC
+
+     # For debugging only:
+     # Takes no operands but simply emits whatever follows in // comments as
+     # a line of C++ code in the generated LLIntAssembly.h file. This can be
+     # used to insert instrumentation into the interpreter loop to inspect
+     # variables of interest. Do not leave these instructions in production
+     # code.
+     "cloopDo",              # no operands
     ]
 
-INSTRUCTIONS = MACRO_INSTRUCTIONS + X86_INSTRUCTIONS + ARMv7_INSTRUCTIONS
+INSTRUCTIONS = MACRO_INSTRUCTIONS + X86_INSTRUCTIONS + RISC_INSTRUCTIONS + MIPS_INSTRUCTIONS + SH4_INSTRUCTIONS + CXX_INSTRUCTIONS
 
 INSTRUCTION_PATTERN = Regexp.new('\\A((' + INSTRUCTIONS.join(')|(') + '))\\Z')