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 #ifndef incl_HPHP_VM_REGALGORITHMS_H_
18 #define incl_HPHP_VM_REGALGORITHMS_H_
22 #include "hphp/runtime/vm/jit/containers.h"
23 #include "hphp/runtime/vm/jit/phys-reg.h"
24 #include "hphp/runtime/vm/jit/vasm-reg.h"
26 namespace HPHP
{ namespace jit
{
27 ///////////////////////////////////////////////////////////////////////////////
31 ///////////////////////////////////////////////////////////////////////////////
34 * Compute a sequence of moves and swaps that will fill the dest registers in
35 * the moves map with their correct source values, even if some sources are
36 * also destinations. The moves map provides one source for each dest. rTmp
37 * will be used when necessary to break copy-cycles, so it is illegal to
38 * specify a source for rTmp (rTmp cannot be a destination). However, it is
39 * legal for rTmp to be a source for some other destination. Since rTmp cannot
40 * be a destination, it cannot be in a copy-cycle, so its value will be read
41 * before we deal with cycles.
45 enum class Kind
{ Move
, Xchg
};
51 enum class Kind
{ Move
, Xchg
};
56 using MovePlan
= PhysReg::Map
<PhysReg
>;
57 jit::vector
<VMoveInfo
> doVregMoves(Vunit
&, MovePlan
& moves
);
58 jit::vector
<MoveInfo
> doRegMoves(MovePlan
& moves
, PhysReg rTmp
);
60 ///////////////////////////////////////////////////////////////////////////////