1 # Copyright (C) 2011 Apple Inc. All rights reserved.
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions
6 # 1. Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer.
8 # 2. Redistributions in binary form must reproduce the above copyright
9 # notice, this list of conditions and the following disclaimer in the
10 # documentation and/or other materials provided with the distribution.
12 # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
13 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
14 # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
16 # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
22 # THE POSSIBILITY OF SUCH DAMAGE.
27 # Interesting invariant, which we take advantage of: branching instructions
28 # always begin with "b", and no non-branching instructions begin with "b".
29 # Terminal instructions are "jmp" and "ret".
69 "fii2d", # usage: fii2d <gpr with least significant bits>, <gpr with most significant bits>, <fpr>
70 "fd2ii", # usage: fd2ii <fpr>, <gpr with least significant bits>, <gpr with most significant bits>
270 "pcrtoaddr", # Address from PC relative offset - adr instruction
271 "popLRAndFP", # ARM64 requires registers to be pushed and popped in pairs,
272 "pushLRAndFP" # therefore we do LR (link register) and FP (frame pointer) together.
277 "smulli", # Multiply two 32-bit words and produce a 64-bit word
278 "addis", # Add integers and set a flag.
279 "subis", # Same, but for subtraction.
280 "oris", # Same, but for bitwise or.
281 "addps" # addis but for pointers.
304 "loaddReversedAndIncrementAddress",
305 "storedReversedAndDecrementAddress",
313 "cloopCrash", # no operands
314 "cloopCallJSFunction", # operands: callee
315 "cloopCallNative", # operands: callee
316 "cloopCallSlowPath", # operands: callTarget, currentFrame, currentPC
317 "cloopCallSlowPathVoid", # operands: callTarget, currentFrame, currentPC
319 # For debugging only:
320 # Takes no operands but simply emits whatever follows in // comments as
321 # a line of C++ code in the generated LLIntAssembly.h file. This can be
322 # used to insert instrumentation into the interpreter loop to inspect
323 # variables of interest. Do not leave these instructions in production
325 "cloopDo", # no operands
328 INSTRUCTIONS
= MACRO_INSTRUCTIONS + X86_INSTRUCTIONS + ARM_INSTRUCTIONS + ARM64_INSTRUCTIONS + RISC_INSTRUCTIONS + MIPS_INSTRUCTIONS + SH4_INSTRUCTIONS + CXX_INSTRUCTIONS
330 INSTRUCTION_SET
= INSTRUCTIONS
.to_set
332 def isBranch(instruction
)
336 def hasFallThrough(instruction
)
337 instruction !
= "ret" and instruction !
= "jmp"