X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/6fe7ccc865dc7d7541b93c5bcaf6368d2c98a174..12899fa232562c774004a3a9d7d3149944dec712:/offlineasm/instructions.rb diff --git a/offlineasm/instructions.rb b/offlineasm/instructions.rb index 67cec6d..10647bd 100644 --- a/offlineasm/instructions.rb +++ b/offlineasm/instructions.rb @@ -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 , , "fd2ii", # usage: fd2ii , , - "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')