2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #include "hphp/runtime/vm/jit/vasm-instr.h"
19 namespace HPHP
{ namespace jit
{
20 ///////////////////////////////////////////////////////////////////////////////
22 #define O(name, ...) \
23 static_assert(sizeof(name) <= 48, "vasm struct " #name " is too big");
26 static_assert(sizeof(Vinstr
) <= 64, "Vinstr should be <= 64 bytes");
28 const char* vinst_names
[] = {
29 #define O(name, imms, uses, defs) #name,
34 ///////////////////////////////////////////////////////////////////////////////
36 bool isBlockEnd(const Vinstr
& inst
) {
38 // service request-y things
40 case Vinstr::fallback
:
41 case Vinstr::retransopt
:
51 case Vinstr::debugguardjmp
:
53 case Vinstr::tailcallstub
:
54 case Vinstr::tailcallstubr
:
55 case Vinstr::resumetc
:
59 case Vinstr::contenter
:
66 case Vinstr::fallthru
:
73 bool isCall(Vinstr::Opcode op
) {
76 case Vinstr::callfaststub
:
79 case Vinstr::callphpr
:
80 case Vinstr::callphps
:
83 case Vinstr::callstub
:
84 case Vinstr::tailcallstub
:
85 case Vinstr::tailcallstubr
:
94 Width
width(Vinstr::Opcode op
) {
99 case Vinstr::bindaddr
:
100 case Vinstr::fallback
:
101 case Vinstr::fallbackcc
:
102 case Vinstr::retransopt
:
104 case Vinstr::conjure
:
105 case Vinstr::conjureuse
:
108 case Vinstr::copyargs
:
109 case Vinstr::debugguardjmp
:
110 case Vinstr::debugtrap
:
111 case Vinstr::fallthru
:
116 case Vinstr::ldundefq
:
123 case Vinstr::inlinestart
:
124 case Vinstr::inlineend
:
125 case Vinstr::pushframe
:
126 case Vinstr::popframe
:
127 case Vinstr::recordstack
:
128 case Vinstr::recordbasenativesp
:
130 case Vinstr::spillbi
:
131 case Vinstr::spillli
:
132 case Vinstr::spillqi
:
133 case Vinstr::spillundefq
:
135 case Vinstr::ssaalias
:
136 // native function abi
138 case Vinstr::vinvoke
:
145 case Vinstr::stublogue
:
146 case Vinstr::unstublogue
:
147 case Vinstr::stubret
:
148 case Vinstr::callstub
:
149 case Vinstr::callfaststub
:
150 case Vinstr::tailcallstub
:
151 case Vinstr::tailcallstubr
:
152 case Vinstr::stubunwind
:
154 case Vinstr::defvmsp
:
155 case Vinstr::defvmfp
:
156 case Vinstr::pushvmfp
:
157 case Vinstr::popvmfp
:
158 case Vinstr::syncvmsp
:
159 case Vinstr::defvmretdata
:
160 case Vinstr::defvmrettype
:
161 case Vinstr::syncvmret
:
162 case Vinstr::syncvmrettype
:
163 case Vinstr::phplogue
:
164 case Vinstr::stubtophp
:
165 case Vinstr::loadstubret
:
167 case Vinstr::callphp
:
168 case Vinstr::callphpr
:
169 case Vinstr::callphps
:
170 case Vinstr::contenter
:
172 case Vinstr::resumetc
:
174 case Vinstr::leavetc
:
175 // exception intrinsics
176 case Vinstr::landingpad
:
177 case Vinstr::nothrow
:
178 case Vinstr::syncpoint
:
183 // restrict/unrestrict new virtuals
184 case Vinstr::vregrestrict
:
185 case Vinstr::vregunrestrict
:
186 // sign/zero-extending/truncating copies
222 // floating-point conversions
223 case Vinstr::cvttsd2siq
:
224 case Vinstr::cvtsi2sd
:
225 case Vinstr::cvtsi2sdm
:
226 case Vinstr::unpcklpd
:
237 // ppc64 instructions
259 case Vinstr::testbim
:
266 case Vinstr::loadtqb
:
268 case Vinstr::storebi
:
285 case Vinstr::testwim
:
290 case Vinstr::storewi
:
317 case Vinstr::testlim
:
321 case Vinstr::loadzbl
:
322 case Vinstr::loadsbl
:
323 case Vinstr::loadtql
:
325 case Vinstr::storeli
:
336 case Vinstr::andqi64
:
339 case Vinstr::decqmlock
:
369 case Vinstr::testqim
:
379 case Vinstr::loadzbq
:
380 case Vinstr::loadzlq
:
381 case Vinstr::loadsbq
:
382 case Vinstr::storeqi
:
386 case Vinstr::ucomisd
:
388 case Vinstr::storesd
:
392 case Vinstr::roundsd
:
397 case Vinstr::loadups
:
398 case Vinstr::storeups
:
404 ///////////////////////////////////////////////////////////////////////////////