/asmjit/src/asmjit/x86/x86func.cpp

http://asmjit.googlecode.com/ · C++ · 645 lines · 418 code · 129 blank · 98 comment · 62 complexity · bee2c3a18972bd0b49a85b17173b6e82 MD5 · raw file

  1. // [AsmJit]
  2. // Complete JIT Assembler for C++ Language.
  3. //
  4. // [License]
  5. // Zlib - See COPYING file in this package.
  6. #define ASMJIT_EXPORTS
  7. // [Dependencies - AsmJit]
  8. #include "../core/assert.h"
  9. #include "../core/intutil.h"
  10. #include "../core/stringutil.h"
  11. #include "../x86/x86defs.h"
  12. #include "../x86/x86func.h"
  13. #include "../x86/x86util.h"
  14. // [Api-Begin]
  15. #include "../core/apibegin.h"
  16. namespace AsmJit {
  17. // ============================================================================
  18. // [AsmJit::X86FuncDecl - Accessors]
  19. // ============================================================================
  20. uint32_t X86FuncDecl::findArgumentByRegCode(uint32_t regCode) const
  21. {
  22. uint32_t type = regCode & kRegTypeMask;
  23. uint32_t idx = regCode & kRegIndexMask;
  24. uint32_t clazz;
  25. switch (type)
  26. {
  27. case kX86RegTypeGpd:
  28. case kX86RegTypeGpq:
  29. clazz = kX86VarClassGp;
  30. break;
  31. case kX86RegTypeX87:
  32. clazz = kX86VarClassX87;
  33. break;
  34. case kX86RegTypeMm:
  35. clazz = kX86VarClassMm;
  36. break;
  37. case kX86RegTypeXmm:
  38. clazz = kX86VarClassXmm;
  39. break;
  40. default:
  41. return kInvalidValue;
  42. }
  43. for (uint32_t i = 0; i < _argumentsCount; i++)
  44. {
  45. const FuncArg& arg = _arguments[i];
  46. if (arg.getRegIndex() == idx && (X86Util::getVarClassFromVarType(arg.getVarType()) & clazz) != 0)
  47. return i;
  48. }
  49. return kInvalidValue;
  50. }
  51. // ============================================================================
  52. // [AsmJit::X86FuncDecl - SetPrototype - InitCallingConvention]
  53. // ============================================================================
  54. static void X86FuncDecl_initCallingConvention(X86FuncDecl* self, uint32_t convention)
  55. {
  56. uint32_t i;
  57. // --------------------------------------------------------------------------
  58. // [Inir]
  59. // --------------------------------------------------------------------------
  60. self->_convention = convention;
  61. self->_calleePopsStack = false;
  62. self->_argumentsDirection = kFuncArgsRTL;
  63. for (i = 0; i < ASMJIT_ARRAY_SIZE(self->_gpList); i++)
  64. self->_gpList[i] = kRegIndexInvalid;
  65. for (i = 0; i < ASMJIT_ARRAY_SIZE(self->_xmmList); i++)
  66. self->_xmmList[i] = kRegIndexInvalid;
  67. self->_gpListMask = 0x0;
  68. self->_mmListMask = 0x0;
  69. self->_xmmListMask = 0x0;
  70. self->_gpPreservedMask = 0x0;
  71. self->_mmPreservedMask = 0x0;
  72. self->_xmmPreservedMask = 0x0;
  73. // --------------------------------------------------------------------------
  74. // [X86 Calling Conventions]
  75. // --------------------------------------------------------------------------
  76. #if defined(ASMJIT_X86)
  77. self->_gpPreservedMask = static_cast<uint16_t>(
  78. IntUtil::maskFromIndex(kX86RegIndexEbx) |
  79. IntUtil::maskFromIndex(kX86RegIndexEsp) |
  80. IntUtil::maskFromIndex(kX86RegIndexEbp) |
  81. IntUtil::maskFromIndex(kX86RegIndexEsi) |
  82. IntUtil::maskFromIndex(kX86RegIndexEdi));
  83. self->_xmmPreservedMask = 0;
  84. switch (convention)
  85. {
  86. // ------------------------------------------------------------------------
  87. // [CDecl]
  88. // ------------------------------------------------------------------------
  89. case kX86FuncConvCDecl:
  90. break;
  91. // ------------------------------------------------------------------------
  92. // [StdCall]
  93. // ------------------------------------------------------------------------
  94. case kX86FuncConvStdCall:
  95. self->_calleePopsStack = true;
  96. break;
  97. // ------------------------------------------------------------------------
  98. // [MS-ThisCall]
  99. // ------------------------------------------------------------------------
  100. case kX86FuncConvMsThisCall:
  101. self->_calleePopsStack = true;
  102. self->_gpList[0] = kX86RegIndexEcx;
  103. self->_gpListMask = static_cast<uint16_t>(
  104. IntUtil::maskFromIndex(kX86RegIndexEcx));
  105. break;
  106. // ------------------------------------------------------------------------
  107. // [MS-FastCall]
  108. // ------------------------------------------------------------------------
  109. case kX86FuncConvMsFastCall:
  110. self->_calleePopsStack = true;
  111. self->_gpList[0] = kX86RegIndexEcx;
  112. self->_gpList[1] = kX86RegIndexEdx;
  113. self->_gpListMask = static_cast<uint16_t>(
  114. IntUtil::maskFromIndex(kX86RegIndexEcx) |
  115. IntUtil::maskFromIndex(kX86RegIndexEdx));
  116. break;
  117. // ------------------------------------------------------------------------
  118. // [Borland-FastCall]
  119. // ------------------------------------------------------------------------
  120. case kX86FuncConvBorlandFastCall:
  121. self->_calleePopsStack = true;
  122. self->_argumentsDirection = kFuncArgsLTR;
  123. self->_gpList[0] = kX86RegIndexEax;
  124. self->_gpList[1] = kX86RegIndexEdx;
  125. self->_gpList[2] = kX86RegIndexEcx;
  126. self->_gpListMask = static_cast<uint16_t>(
  127. IntUtil::maskFromIndex(kX86RegIndexEax) |
  128. IntUtil::maskFromIndex(kX86RegIndexEdx) |
  129. IntUtil::maskFromIndex(kX86RegIndexEcx));
  130. break;
  131. // ------------------------------------------------------------------------
  132. // [Gcc-FastCall]
  133. // ------------------------------------------------------------------------
  134. case kX86FuncConvGccFastCall:
  135. self->_calleePopsStack = true;
  136. self->_gpList[0] = kX86RegIndexEcx;
  137. self->_gpList[1] = kX86RegIndexEdx;
  138. self->_gpListMask = static_cast<uint16_t>(
  139. IntUtil::maskFromIndex(kX86RegIndexEcx) |
  140. IntUtil::maskFromIndex(kX86RegIndexEdx));
  141. break;
  142. // ------------------------------------------------------------------------
  143. // [Gcc-Regparm(1)]
  144. // ------------------------------------------------------------------------
  145. case kX86FuncConvGccRegParm1:
  146. self->_calleePopsStack = false;
  147. self->_gpList[0] = kX86RegIndexEax;
  148. self->_gpListMask = static_cast<uint16_t>(
  149. IntUtil::maskFromIndex(kX86RegIndexEax));
  150. break;
  151. // ------------------------------------------------------------------------
  152. // [Gcc-Regparm(2)]
  153. // ------------------------------------------------------------------------
  154. case kX86FuncConvGccRegParm2:
  155. self->_calleePopsStack = false;
  156. self->_gpList[0] = kX86RegIndexEax;
  157. self->_gpList[1] = kX86RegIndexEdx;
  158. self->_gpListMask = static_cast<uint16_t>(
  159. IntUtil::maskFromIndex(kX86RegIndexEax) |
  160. IntUtil::maskFromIndex(kX86RegIndexEdx));
  161. break;
  162. // ------------------------------------------------------------------------
  163. // [Gcc-Regparm(3)]
  164. // ------------------------------------------------------------------------
  165. case kX86FuncConvGccRegParm3:
  166. self->_calleePopsStack = false;
  167. self->_gpList[0] = kX86RegIndexEax;
  168. self->_gpList[1] = kX86RegIndexEdx;
  169. self->_gpList[2] = kX86RegIndexEcx;
  170. self->_gpListMask = static_cast<uint16_t>(
  171. IntUtil::maskFromIndex(kX86RegIndexEax) |
  172. IntUtil::maskFromIndex(kX86RegIndexEdx) |
  173. IntUtil::maskFromIndex(kX86RegIndexEcx));
  174. break;
  175. // ------------------------------------------------------------------------
  176. // [Illegal]
  177. // ------------------------------------------------------------------------
  178. default:
  179. // Illegal calling convention.
  180. ASMJIT_ASSERT(0);
  181. }
  182. #endif // ASMJIT_X86
  183. // --------------------------------------------------------------------------
  184. // [X64 Calling Conventions]
  185. // --------------------------------------------------------------------------
  186. #if defined(ASMJIT_X64)
  187. switch (convention)
  188. {
  189. // ------------------------------------------------------------------------
  190. // [X64-Windows]
  191. // ------------------------------------------------------------------------
  192. case kX86FuncConvX64W:
  193. self->_gpList[0] = kX86RegIndexRcx;
  194. self->_gpList[1] = kX86RegIndexRdx;
  195. self->_gpList[2] = kX86RegIndexR8;
  196. self->_gpList[3] = kX86RegIndexR9;
  197. self->_xmmList[0] = kX86RegIndexXmm0;
  198. self->_xmmList[1] = kX86RegIndexXmm1;
  199. self->_xmmList[2] = kX86RegIndexXmm2;
  200. self->_xmmList[3] = kX86RegIndexXmm3;
  201. self->_gpListMask = static_cast<uint16_t>(
  202. IntUtil::maskFromIndex(kX86RegIndexRcx ) |
  203. IntUtil::maskFromIndex(kX86RegIndexRdx ) |
  204. IntUtil::maskFromIndex(kX86RegIndexR8 ) |
  205. IntUtil::maskFromIndex(kX86RegIndexR9 ));
  206. self->_xmmListMask = static_cast<uint16_t>(
  207. IntUtil::maskFromIndex(kX86RegIndexXmm0 ) |
  208. IntUtil::maskFromIndex(kX86RegIndexXmm1 ) |
  209. IntUtil::maskFromIndex(kX86RegIndexXmm2 ) |
  210. IntUtil::maskFromIndex(kX86RegIndexXmm3 ));
  211. self->_gpPreservedMask = static_cast<uint16_t>(
  212. IntUtil::maskFromIndex(kX86RegIndexRbx ) |
  213. IntUtil::maskFromIndex(kX86RegIndexRsp ) |
  214. IntUtil::maskFromIndex(kX86RegIndexRbp ) |
  215. IntUtil::maskFromIndex(kX86RegIndexRsi ) |
  216. IntUtil::maskFromIndex(kX86RegIndexRdi ) |
  217. IntUtil::maskFromIndex(kX86RegIndexR12 ) |
  218. IntUtil::maskFromIndex(kX86RegIndexR13 ) |
  219. IntUtil::maskFromIndex(kX86RegIndexR14 ) |
  220. IntUtil::maskFromIndex(kX86RegIndexR15 ));
  221. self->_xmmPreservedMask = static_cast<uint16_t>(
  222. IntUtil::maskFromIndex(kX86RegIndexXmm6 ) |
  223. IntUtil::maskFromIndex(kX86RegIndexXmm7 ) |
  224. IntUtil::maskFromIndex(kX86RegIndexXmm8 ) |
  225. IntUtil::maskFromIndex(kX86RegIndexXmm9 ) |
  226. IntUtil::maskFromIndex(kX86RegIndexXmm10) |
  227. IntUtil::maskFromIndex(kX86RegIndexXmm11) |
  228. IntUtil::maskFromIndex(kX86RegIndexXmm12) |
  229. IntUtil::maskFromIndex(kX86RegIndexXmm13) |
  230. IntUtil::maskFromIndex(kX86RegIndexXmm14) |
  231. IntUtil::maskFromIndex(kX86RegIndexXmm15));
  232. break;
  233. // ------------------------------------------------------------------------
  234. // [X64-Unix]
  235. // ------------------------------------------------------------------------
  236. case kX86FuncConvX64U:
  237. self->_gpList[0] = kX86RegIndexRdi;
  238. self->_gpList[1] = kX86RegIndexRsi;
  239. self->_gpList[2] = kX86RegIndexRdx;
  240. self->_gpList[3] = kX86RegIndexRcx;
  241. self->_gpList[4] = kX86RegIndexR8;
  242. self->_gpList[5] = kX86RegIndexR9;
  243. self->_xmmList[0] = kX86RegIndexXmm0;
  244. self->_xmmList[1] = kX86RegIndexXmm1;
  245. self->_xmmList[2] = kX86RegIndexXmm2;
  246. self->_xmmList[3] = kX86RegIndexXmm3;
  247. self->_xmmList[4] = kX86RegIndexXmm4;
  248. self->_xmmList[5] = kX86RegIndexXmm5;
  249. self->_xmmList[6] = kX86RegIndexXmm6;
  250. self->_xmmList[7] = kX86RegIndexXmm7;
  251. self->_gpListMask = static_cast<uint16_t>(
  252. IntUtil::maskFromIndex(kX86RegIndexRdi ) |
  253. IntUtil::maskFromIndex(kX86RegIndexRsi ) |
  254. IntUtil::maskFromIndex(kX86RegIndexRdx ) |
  255. IntUtil::maskFromIndex(kX86RegIndexRcx ) |
  256. IntUtil::maskFromIndex(kX86RegIndexR8 ) |
  257. IntUtil::maskFromIndex(kX86RegIndexR9 ));
  258. self->_xmmListMask = static_cast<uint16_t>(
  259. IntUtil::maskFromIndex(kX86RegIndexXmm0 ) |
  260. IntUtil::maskFromIndex(kX86RegIndexXmm1 ) |
  261. IntUtil::maskFromIndex(kX86RegIndexXmm2 ) |
  262. IntUtil::maskFromIndex(kX86RegIndexXmm3 ) |
  263. IntUtil::maskFromIndex(kX86RegIndexXmm4 ) |
  264. IntUtil::maskFromIndex(kX86RegIndexXmm5 ) |
  265. IntUtil::maskFromIndex(kX86RegIndexXmm6 ) |
  266. IntUtil::maskFromIndex(kX86RegIndexXmm7 ));
  267. self->_gpPreservedMask = static_cast<uint16_t>(
  268. IntUtil::maskFromIndex(kX86RegIndexRbx ) |
  269. IntUtil::maskFromIndex(kX86RegIndexRsp ) |
  270. IntUtil::maskFromIndex(kX86RegIndexRbp ) |
  271. IntUtil::maskFromIndex(kX86RegIndexR12 ) |
  272. IntUtil::maskFromIndex(kX86RegIndexR13 ) |
  273. IntUtil::maskFromIndex(kX86RegIndexR14 ) |
  274. IntUtil::maskFromIndex(kX86RegIndexR15 ));
  275. break;
  276. // ------------------------------------------------------------------------
  277. // [Illegal]
  278. // ------------------------------------------------------------------------
  279. default:
  280. // Illegal calling convention.
  281. ASMJIT_ASSERT(0);
  282. }
  283. #endif // ASMJIT_X64
  284. }
  285. // ============================================================================
  286. // [AsmJit::X86FuncDecl - SetPrototype - InitDefinition]
  287. // ============================================================================
  288. static void X86FuncDecl_initDefinition(X86FuncDecl* self,
  289. uint32_t returnType, const uint32_t* argumentsData, uint32_t argumentsCount)
  290. {
  291. ASMJIT_ASSERT(argumentsCount <= kFuncArgsMax);
  292. // --------------------------------------------------------------------------
  293. // [Init]
  294. // --------------------------------------------------------------------------
  295. int32_t i = 0;
  296. int32_t gpPos = 0;
  297. int32_t xmmPos = 0;
  298. int32_t stackOffset = 0;
  299. self->_returnType = returnType;
  300. self->_argumentsCount = static_cast<uint8_t>(argumentsCount);
  301. while (i < static_cast<int32_t>(argumentsCount))
  302. {
  303. FuncArg& arg = self->_arguments[i];
  304. arg._varType = static_cast<uint8_t>(argumentsData[i]);
  305. arg._regIndex = kRegIndexInvalid;
  306. arg._stackOffset = kFuncStackInvalid;
  307. i++;
  308. }
  309. while (i < kFuncArgsMax)
  310. {
  311. FuncArg& arg = self->_arguments[i];
  312. arg.reset();
  313. i++;
  314. }
  315. self->_argumentsStackSize = 0;
  316. self->_gpArgumentsMask = 0x0;
  317. self->_mmArgumentsMask = 0x0;
  318. self->_xmmArgumentsMask = 0x0;
  319. if (self->_argumentsCount == 0)
  320. return;
  321. // --------------------------------------------------------------------------
  322. // [X86 Calling Conventions (32-bit)]
  323. // --------------------------------------------------------------------------
  324. #if defined(ASMJIT_X86)
  325. // Register arguments (Integer), always left-to-right.
  326. for (i = 0; i != argumentsCount; i++)
  327. {
  328. FuncArg& arg = self->_arguments[i];
  329. uint32_t varType = arg.getVarType();
  330. if (X86Util::isVarTypeInt(varType) && gpPos < 16 && self->_gpList[gpPos] != kRegIndexInvalid)
  331. {
  332. arg._regIndex = self->_gpList[gpPos++];
  333. self->_gpArgumentsMask |= static_cast<uint16_t>(IntUtil::maskFromIndex(arg.getRegIndex()));
  334. }
  335. }
  336. // Stack arguments.
  337. int32_t iStart = static_cast<int32_t>(argumentsCount - 1);
  338. int32_t iEnd = -1;
  339. int32_t iStep = -1;
  340. if (self->_argumentsDirection == kFuncArgsLTR)
  341. {
  342. iStart = 0;
  343. iEnd = static_cast<int32_t>(argumentsCount);
  344. iStep = 1;
  345. }
  346. for (i = iStart; i != iEnd; i += iStep)
  347. {
  348. FuncArg& arg = self->_arguments[i];
  349. uint32_t varType = arg.getVarType();
  350. if (arg.hasRegIndex())
  351. continue;
  352. if (X86Util::isVarTypeInt(varType))
  353. {
  354. stackOffset -= 4;
  355. arg._stackOffset = static_cast<int16_t>(stackOffset);
  356. }
  357. else if (X86Util::isVarTypeFloat(varType))
  358. {
  359. int32_t size = static_cast<int32_t>(x86VarInfo[varType].getSize());
  360. stackOffset -= size;
  361. arg._stackOffset = static_cast<int16_t>(stackOffset);
  362. }
  363. }
  364. #endif // ASMJIT_X86
  365. // --------------------------------------------------------------------------
  366. // [X64 Calling Conventions (64-bit)]
  367. // --------------------------------------------------------------------------
  368. #if defined(ASMJIT_X64)
  369. // Windows 64-bit specific.
  370. if (self->_convention == kX86FuncConvX64W)
  371. {
  372. int32_t max = argumentsCount < 4 ? argumentsCount : 4;
  373. // Register arguments (Integer / FP), always left-to-right.
  374. for (i = 0; i != max; i++)
  375. {
  376. FuncArg& arg = self->_arguments[i];
  377. uint32_t varType = arg.getVarType();
  378. if (X86Util::isVarTypeInt(varType))
  379. {
  380. arg._regIndex = self->_gpList[i];
  381. self->_gpArgumentsMask |= static_cast<uint16_t>(IntUtil::maskFromIndex(arg.getRegIndex()));
  382. }
  383. else if (X86Util::isVarTypeFloat(varType))
  384. {
  385. arg._regIndex = self->_xmmList[i];
  386. self->_xmmArgumentsMask |= static_cast<uint16_t>(IntUtil::maskFromIndex(arg.getRegIndex()));
  387. }
  388. }
  389. // Stack arguments (always right-to-left).
  390. for (i = argumentsCount - 1; i != -1; i--)
  391. {
  392. FuncArg& arg = self->_arguments[i];
  393. uint32_t varType = arg.getVarType();
  394. if (arg.isAssigned())
  395. continue;
  396. if (X86Util::isVarTypeInt(varType))
  397. {
  398. stackOffset -= 8; // Always 8 bytes.
  399. arg._stackOffset = stackOffset;
  400. }
  401. else if (X86Util::isVarTypeFloat(varType))
  402. {
  403. int32_t size = static_cast<int32_t>(x86VarInfo[varType].getSize());
  404. stackOffset -= size;
  405. arg._stackOffset = stackOffset;
  406. }
  407. }
  408. // 32 bytes shadow space (X64W calling convention specific).
  409. stackOffset -= 4 * 8;
  410. }
  411. // Linux/Unix 64-bit (AMD64 calling convention).
  412. else
  413. {
  414. // Register arguments (Integer), always left-to-right.
  415. for (i = 0; i != static_cast<int32_t>(argumentsCount); i++)
  416. {
  417. FuncArg& arg = self->_arguments[i];
  418. uint32_t varType = arg.getVarType();
  419. if (X86Util::isVarTypeInt(varType) && gpPos < 32 && self->_gpList[gpPos] != kRegIndexInvalid)
  420. {
  421. arg._regIndex = self->_gpList[gpPos++];
  422. self->_gpArgumentsMask |= static_cast<uint16_t>(IntUtil::maskFromIndex(arg.getRegIndex()));
  423. }
  424. }
  425. // Register arguments (FP), always left-to-right.
  426. for (i = 0; i != static_cast<int32_t>(argumentsCount); i++)
  427. {
  428. FuncArg& arg = self->_arguments[i];
  429. uint32_t varType = arg.getVarType();
  430. if (X86Util::isVarTypeFloat(varType))
  431. {
  432. arg._regIndex = self->_xmmList[xmmPos++];
  433. self->_xmmArgumentsMask |= static_cast<uint16_t>(IntUtil::maskFromIndex(arg.getRegIndex()));
  434. }
  435. }
  436. // Stack arguments.
  437. for (i = argumentsCount - 1; i != -1; i--)
  438. {
  439. FuncArg& arg = self->_arguments[i];
  440. uint32_t varType = arg.getVarType();
  441. if (arg.isAssigned())
  442. continue;
  443. if (X86Util::isVarTypeInt(varType))
  444. {
  445. stackOffset -= 8;
  446. arg._stackOffset = static_cast<int16_t>(stackOffset);
  447. }
  448. else if (X86Util::isVarTypeFloat(varType))
  449. {
  450. int32_t size = (int32_t)x86VarInfo[varType].getSize();
  451. stackOffset -= size;
  452. arg._stackOffset = static_cast<int16_t>(stackOffset);
  453. }
  454. }
  455. }
  456. #endif // ASMJIT_X64
  457. // Modify stack offset (all function parameters will be in positive stack
  458. // offset that is never zero).
  459. for (i = 0; i < (int32_t)argumentsCount; i++)
  460. {
  461. FuncArg& arg = self->_arguments[i];
  462. if (!arg.hasRegIndex())
  463. {
  464. arg._stackOffset += static_cast<uint16_t>(static_cast<int32_t>(sizeof(uintptr_t)) - stackOffset);
  465. }
  466. }
  467. self->_argumentsStackSize = (uint32_t)(-stackOffset);
  468. }
  469. void X86FuncDecl::setPrototype(uint32_t convention, uint32_t returnType, const uint32_t* arguments, uint32_t argumentsCount)
  470. {
  471. // Limit maximum function arguments to kFuncArgsMax.
  472. if (argumentsCount > kFuncArgsMax)
  473. argumentsCount = kFuncArgsMax;
  474. X86FuncDecl_initCallingConvention(this, convention);
  475. X86FuncDecl_initDefinition(this, returnType, arguments, argumentsCount);
  476. }
  477. // ============================================================================
  478. // [AsmJit::X86FuncDecl - Reset]
  479. // ============================================================================
  480. void X86FuncDecl::reset()
  481. {
  482. uint32_t i;
  483. // --------------------------------------------------------------------------
  484. // [Core]
  485. // --------------------------------------------------------------------------
  486. _returnType = kVarTypeInvalid;
  487. _argumentsCount = 0;
  488. _reserved0[0] = 0;
  489. _reserved0[1] = 0;
  490. for (i = 0; i < ASMJIT_ARRAY_SIZE(_arguments); i++)
  491. _arguments[i].reset();
  492. _argumentsStackSize = 0;
  493. _gpArgumentsMask = 0x0;
  494. _mmArgumentsMask = 0x0;
  495. _xmmArgumentsMask = 0x0;
  496. // --------------------------------------------------------------------------
  497. // [Convention]
  498. // --------------------------------------------------------------------------
  499. _convention = kFuncConvNone;
  500. _calleePopsStack = false;
  501. _argumentsDirection = kFuncArgsRTL;
  502. _reserved1 = 0;
  503. for (i = 0; i < ASMJIT_ARRAY_SIZE(_gpList); i++)
  504. _gpList[i] = kRegIndexInvalid;
  505. for (i = 0; i < ASMJIT_ARRAY_SIZE(_xmmList); i++)
  506. _xmmList[i] = kRegIndexInvalid;
  507. _gpListMask = 0x0;
  508. _mmListMask = 0x0;
  509. _xmmListMask = 0x0;
  510. _gpPreservedMask = 0x0;
  511. _mmPreservedMask = 0x0;
  512. _xmmPreservedMask = 0x0;
  513. }
  514. } // AsmJit namespace
  515. // [Api-Begin]
  516. #include "../core/apiend.h"