| 1 |
/* |
| 2 |
* FCML - Free Code Manipulation Library. |
| 3 |
* Copyright (C) 2010-2020 Slawomir Wojtasiak |
| 4 |
* |
| 5 |
* This library is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU Lesser General Public |
| 7 |
* License as published by the Free Software Foundation; either |
| 8 |
* version 2.1 of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This library is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* Lesser General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU Lesser General Public |
| 16 |
* License along with this library; if not, write to the Free Software |
| 17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 |
*/ |
| 19 |
|
| 20 |
#include <fcml_common_utils.h> |
| 21 |
|
| 22 |
#include "fcml_env_int.h" |
| 23 |
|
| 24 |
fcml_st_register fcml_reg_AL = { FCML_REG_GPR, FCML_DS_8, FCML_REG_AL, FCML_FALSE }; |
| 25 |
fcml_st_register fcml_reg_AX = { FCML_REG_GPR, FCML_DS_16, FCML_REG_AX, FCML_FALSE }; |
| 26 |
fcml_st_register fcml_reg_EAX = { FCML_REG_GPR, FCML_DS_32, FCML_REG_EAX, FCML_FALSE } ; |
| 27 |
fcml_st_register fcml_reg_RAX = { FCML_REG_GPR, FCML_DS_64, FCML_REG_RAX, FCML_FALSE }; |
| 28 |
fcml_st_register fcml_reg_MM0 = { FCML_REG_SIMD, FCML_DS_64, FCML_REG_MM0, FCML_FALSE }; |
| 29 |
fcml_st_register fcml_reg_XMM0 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM0, FCML_FALSE }; |
| 30 |
fcml_st_register fcml_reg_YMM0 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM0, FCML_FALSE }; |
| 31 |
fcml_st_register fcml_reg_ZMM0 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 32 |
|
| 33 |
fcml_st_register fcml_reg_CL = { FCML_REG_GPR, FCML_DS_8, FCML_REG_CL, FCML_FALSE }; |
| 34 |
fcml_st_register fcml_reg_CX = { FCML_REG_GPR, FCML_DS_16, FCML_REG_CX, FCML_FALSE }; |
| 35 |
fcml_st_register fcml_reg_ECX = { FCML_REG_GPR, FCML_DS_32, FCML_REG_ECX, FCML_FALSE }; |
| 36 |
fcml_st_register fcml_reg_RCX = { FCML_REG_GPR, FCML_DS_64, FCML_REG_RCX, FCML_FALSE }; |
| 37 |
fcml_st_register fcml_reg_MM1 = { FCML_REG_SIMD, FCML_DS_64, FCML_REG_MM1, FCML_FALSE }; |
| 38 |
fcml_st_register fcml_reg_XMM1 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM1, FCML_FALSE }; |
| 39 |
fcml_st_register fcml_reg_YMM1 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM1, FCML_FALSE }; |
| 40 |
fcml_st_register fcml_reg_ZMM1 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 41 |
|
| 42 |
fcml_st_register fcml_reg_DL = { FCML_REG_GPR, FCML_DS_8, FCML_REG_DL, FCML_FALSE }; |
| 43 |
fcml_st_register fcml_reg_DX = { FCML_REG_GPR, FCML_DS_16, FCML_REG_DX, FCML_FALSE }; |
| 44 |
fcml_st_register fcml_reg_EDX = { FCML_REG_GPR, FCML_DS_32, FCML_REG_EDX, FCML_FALSE }; |
| 45 |
fcml_st_register fcml_reg_RDX = { FCML_REG_GPR, FCML_DS_64, FCML_REG_RDX, FCML_FALSE }; |
| 46 |
fcml_st_register fcml_reg_MM2 = { FCML_REG_SIMD, FCML_DS_64, FCML_REG_MM2, FCML_FALSE }; |
| 47 |
fcml_st_register fcml_reg_XMM2 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM2, FCML_FALSE }; |
| 48 |
fcml_st_register fcml_reg_YMM2 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM2, FCML_FALSE }; |
| 49 |
fcml_st_register fcml_reg_ZMM2 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 50 |
|
| 51 |
fcml_st_register fcml_reg_BL = { FCML_REG_GPR, FCML_DS_8, FCML_REG_BL, FCML_FALSE }; |
| 52 |
fcml_st_register fcml_reg_BX = { FCML_REG_GPR, FCML_DS_16, FCML_REG_BX, FCML_FALSE }; |
| 53 |
fcml_st_register fcml_reg_EBX = { FCML_REG_GPR, FCML_DS_32, FCML_REG_EBX, FCML_FALSE }; |
| 54 |
fcml_st_register fcml_reg_RBX = { FCML_REG_GPR, FCML_DS_64, FCML_REG_RBX, FCML_FALSE }; |
| 55 |
fcml_st_register fcml_reg_MM3 = { FCML_REG_SIMD, FCML_DS_64, FCML_REG_MM3, FCML_FALSE }; |
| 56 |
fcml_st_register fcml_reg_XMM3 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM3, FCML_FALSE }; |
| 57 |
fcml_st_register fcml_reg_YMM3 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM3, FCML_FALSE }; |
| 58 |
fcml_st_register fcml_reg_ZMM3 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 59 |
|
| 60 |
fcml_st_register fcml_reg_AH = { FCML_REG_GPR, FCML_DS_8, FCML_REG_AH, FCML_FALSE }; |
| 61 |
fcml_st_register fcml_reg_SPL = { FCML_REG_GPR, FCML_DS_8, FCML_REG_SPL, FCML_TRUE }; |
| 62 |
fcml_st_register fcml_reg_SP = { FCML_REG_GPR, FCML_DS_16, FCML_REG_SP, FCML_FALSE }; |
| 63 |
fcml_st_register fcml_reg_ESP = { FCML_REG_GPR, FCML_DS_32, FCML_REG_ESP, FCML_FALSE }; |
| 64 |
fcml_st_register fcml_reg_RSP = { FCML_REG_GPR, FCML_DS_64, FCML_REG_RSP, FCML_FALSE }; |
| 65 |
fcml_st_register fcml_reg_MM4 = { FCML_REG_SIMD, FCML_DS_64, FCML_REG_MM4, FCML_FALSE }; |
| 66 |
fcml_st_register fcml_reg_XMM4 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM4, FCML_FALSE }; |
| 67 |
fcml_st_register fcml_reg_YMM4 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM4, FCML_FALSE }; |
| 68 |
fcml_st_register fcml_reg_ZMM4 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 69 |
|
| 70 |
fcml_st_register fcml_reg_CH = { FCML_REG_GPR, FCML_DS_8, FCML_REG_CH, FCML_FALSE }; |
| 71 |
fcml_st_register fcml_reg_BPL = { FCML_REG_GPR, FCML_DS_8, FCML_REG_BPL, FCML_TRUE }; |
| 72 |
fcml_st_register fcml_reg_BP = { FCML_REG_GPR, FCML_DS_16, FCML_REG_BP, FCML_FALSE }; |
| 73 |
fcml_st_register fcml_reg_EBP = { FCML_REG_GPR, FCML_DS_32, FCML_REG_EBP, FCML_FALSE }; |
| 74 |
fcml_st_register fcml_reg_RBP = { FCML_REG_GPR, FCML_DS_64, FCML_REG_RBP, FCML_FALSE }; |
| 75 |
fcml_st_register fcml_reg_MM5 = { FCML_REG_SIMD, FCML_DS_64, FCML_REG_MM5, FCML_FALSE }; |
| 76 |
fcml_st_register fcml_reg_XMM5 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM5, FCML_FALSE }; |
| 77 |
fcml_st_register fcml_reg_YMM5 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM5, FCML_FALSE }; |
| 78 |
fcml_st_register fcml_reg_ZMM5 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 79 |
|
| 80 |
fcml_st_register fcml_reg_DH = { FCML_REG_GPR, FCML_DS_8, FCML_REG_DH, FCML_FALSE }; |
| 81 |
fcml_st_register fcml_reg_SIL = { FCML_REG_GPR, FCML_DS_8, FCML_REG_SIL, FCML_TRUE }; |
| 82 |
fcml_st_register fcml_reg_SI = { FCML_REG_GPR, FCML_DS_16, FCML_REG_SI, FCML_FALSE }; |
| 83 |
fcml_st_register fcml_reg_ESI = { FCML_REG_GPR, FCML_DS_32, FCML_REG_ESI, FCML_FALSE }; |
| 84 |
fcml_st_register fcml_reg_RSI = { FCML_REG_GPR, FCML_DS_64, FCML_REG_RSI, FCML_FALSE }; |
| 85 |
fcml_st_register fcml_reg_MM6 = { FCML_REG_SIMD, FCML_DS_64, FCML_REG_MM6, FCML_FALSE }; |
| 86 |
fcml_st_register fcml_reg_XMM6 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM6, FCML_FALSE }; |
| 87 |
fcml_st_register fcml_reg_YMM6 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM6, FCML_FALSE }; |
| 88 |
fcml_st_register fcml_reg_ZMM6 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 89 |
|
| 90 |
fcml_st_register fcml_reg_BH = { FCML_REG_GPR, FCML_DS_8, FCML_REG_BH, FCML_FALSE }; |
| 91 |
fcml_st_register fcml_reg_DIL = { FCML_REG_GPR, FCML_DS_8, FCML_REG_DIL, FCML_TRUE }; |
| 92 |
fcml_st_register fcml_reg_DI = { FCML_REG_GPR, FCML_DS_16, FCML_REG_DI, FCML_FALSE }; |
| 93 |
fcml_st_register fcml_reg_EDI = { FCML_REG_GPR, FCML_DS_32, FCML_REG_EDI, FCML_FALSE }; |
| 94 |
fcml_st_register fcml_reg_RDI = { FCML_REG_GPR, FCML_DS_64, FCML_REG_RDI, FCML_FALSE }; |
| 95 |
fcml_st_register fcml_reg_MM7 = { FCML_REG_SIMD, FCML_DS_64, FCML_REG_MM7, FCML_FALSE }; |
| 96 |
fcml_st_register fcml_reg_XMM7 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM7, FCML_FALSE }; |
| 97 |
fcml_st_register fcml_reg_YMM7 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM7, FCML_FALSE }; |
| 98 |
fcml_st_register fcml_reg_ZMM7 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 99 |
|
| 100 |
fcml_st_register fcml_reg_R8L = { FCML_REG_GPR, FCML_DS_8, FCML_REG_R8L, FCML_FALSE }; |
| 101 |
fcml_st_register fcml_reg_R8W = { FCML_REG_GPR, FCML_DS_16, FCML_REG_R8W, FCML_FALSE }; |
| 102 |
fcml_st_register fcml_reg_R8D = { FCML_REG_GPR, FCML_DS_32, FCML_REG_R8D, FCML_FALSE }; |
| 103 |
fcml_st_register fcml_reg_R8 = { FCML_REG_GPR, FCML_DS_64, FCML_REG_R8, FCML_FALSE }; |
| 104 |
fcml_st_register fcml_reg_XMM8 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM8, FCML_FALSE }; |
| 105 |
fcml_st_register fcml_reg_YMM8 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM8, FCML_FALSE }; |
| 106 |
fcml_st_register fcml_reg_ZMM8 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 107 |
|
| 108 |
fcml_st_register fcml_reg_R9L = { FCML_REG_GPR, FCML_DS_8, FCML_REG_R9L, FCML_FALSE }; |
| 109 |
fcml_st_register fcml_reg_R9W = { FCML_REG_GPR, FCML_DS_16, FCML_REG_R9W, FCML_FALSE }; |
| 110 |
fcml_st_register fcml_reg_R9D = { FCML_REG_GPR, FCML_DS_32, FCML_REG_R9D, FCML_FALSE }; |
| 111 |
fcml_st_register fcml_reg_R9 = { FCML_REG_GPR, FCML_DS_64, FCML_REG_R9, FCML_FALSE }; |
| 112 |
fcml_st_register fcml_reg_XMM9 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM9, FCML_FALSE }; |
| 113 |
fcml_st_register fcml_reg_YMM9 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM9, FCML_FALSE }; |
| 114 |
fcml_st_register fcml_reg_ZMM9 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 115 |
|
| 116 |
fcml_st_register fcml_reg_R10L = { FCML_REG_GPR, FCML_DS_8, FCML_REG_R10L, FCML_FALSE }; |
| 117 |
fcml_st_register fcml_reg_R10W = { FCML_REG_GPR, FCML_DS_16, FCML_REG_R10W, FCML_FALSE }; |
| 118 |
fcml_st_register fcml_reg_R10D = { FCML_REG_GPR, FCML_DS_32, FCML_REG_R10D, FCML_FALSE }; |
| 119 |
fcml_st_register fcml_reg_R10 = { FCML_REG_GPR, FCML_DS_64, FCML_REG_R10, FCML_FALSE }; |
| 120 |
fcml_st_register fcml_reg_XMM10 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM10, FCML_FALSE }; |
| 121 |
fcml_st_register fcml_reg_YMM10 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM10, FCML_FALSE }; |
| 122 |
fcml_st_register fcml_reg_ZMM10 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 123 |
|
| 124 |
fcml_st_register fcml_reg_R11L = { FCML_REG_GPR, FCML_DS_8, FCML_REG_R11L, FCML_FALSE }; |
| 125 |
fcml_st_register fcml_reg_R11W = { FCML_REG_GPR, FCML_DS_16, FCML_REG_R11W, FCML_FALSE }; |
| 126 |
fcml_st_register fcml_reg_R11D = { FCML_REG_GPR, FCML_DS_32, FCML_REG_R11D, FCML_FALSE }; |
| 127 |
fcml_st_register fcml_reg_R11 = { FCML_REG_GPR, FCML_DS_64, FCML_REG_R11, FCML_FALSE }; |
| 128 |
fcml_st_register fcml_reg_XMM11 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM11, FCML_FALSE }; |
| 129 |
fcml_st_register fcml_reg_YMM11 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM11, FCML_FALSE }; |
| 130 |
fcml_st_register fcml_reg_ZMM11 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 131 |
|
| 132 |
fcml_st_register fcml_reg_R12L = { FCML_REG_GPR, FCML_DS_8, FCML_REG_R12L, FCML_FALSE }; |
| 133 |
fcml_st_register fcml_reg_R12W = { FCML_REG_GPR, FCML_DS_16, FCML_REG_R12W, FCML_FALSE }; |
| 134 |
fcml_st_register fcml_reg_R12D = { FCML_REG_GPR, FCML_DS_32, FCML_REG_R12D, FCML_FALSE }; |
| 135 |
fcml_st_register fcml_reg_R12 = { FCML_REG_GPR, FCML_DS_64, FCML_REG_R12, FCML_FALSE }; |
| 136 |
fcml_st_register fcml_reg_XMM12 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM12, FCML_FALSE }; |
| 137 |
fcml_st_register fcml_reg_YMM12 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM12, FCML_FALSE }; |
| 138 |
fcml_st_register fcml_reg_ZMM12 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 139 |
|
| 140 |
fcml_st_register fcml_reg_R13L = { FCML_REG_GPR, FCML_DS_8, FCML_REG_R13L, FCML_FALSE }; |
| 141 |
fcml_st_register fcml_reg_R13W = { FCML_REG_GPR, FCML_DS_16, FCML_REG_R13W, FCML_FALSE }; |
| 142 |
fcml_st_register fcml_reg_R13D = { FCML_REG_GPR, FCML_DS_32, FCML_REG_R13D, FCML_FALSE }; |
| 143 |
fcml_st_register fcml_reg_R13 = { FCML_REG_GPR, FCML_DS_64, FCML_REG_R13, FCML_FALSE }; |
| 144 |
fcml_st_register fcml_reg_XMM13 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM13, FCML_FALSE }; |
| 145 |
fcml_st_register fcml_reg_YMM13 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM13, FCML_FALSE }; |
| 146 |
fcml_st_register fcml_reg_ZMM13 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 147 |
|
| 148 |
fcml_st_register fcml_reg_R14L = { FCML_REG_GPR, FCML_DS_8, FCML_REG_R14L, FCML_FALSE }; |
| 149 |
fcml_st_register fcml_reg_R14W = { FCML_REG_GPR, FCML_DS_16, FCML_REG_R14W, FCML_FALSE }; |
| 150 |
fcml_st_register fcml_reg_R14D = { FCML_REG_GPR, FCML_DS_32, FCML_REG_R14D, FCML_FALSE }; |
| 151 |
fcml_st_register fcml_reg_R14 = { FCML_REG_GPR, FCML_DS_64, FCML_REG_R14, FCML_FALSE }; |
| 152 |
fcml_st_register fcml_reg_XMM14 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM14, FCML_FALSE }; |
| 153 |
fcml_st_register fcml_reg_YMM14 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM14, FCML_FALSE }; |
| 154 |
fcml_st_register fcml_reg_ZMM14 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 155 |
|
| 156 |
fcml_st_register fcml_reg_R15L = { FCML_REG_GPR, FCML_DS_8, FCML_REG_R15L, FCML_FALSE }; |
| 157 |
fcml_st_register fcml_reg_R15W = { FCML_REG_GPR, FCML_DS_16, FCML_REG_R15W, FCML_FALSE }; |
| 158 |
fcml_st_register fcml_reg_R15D = { FCML_REG_GPR, FCML_DS_32, FCML_REG_R15D, FCML_FALSE }; |
| 159 |
fcml_st_register fcml_reg_R15 = { FCML_REG_GPR, FCML_DS_64, FCML_REG_R15, FCML_FALSE }; |
| 160 |
fcml_st_register fcml_reg_XMM15 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 161 |
fcml_st_register fcml_reg_YMM15 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 162 |
fcml_st_register fcml_reg_ZMM15 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 163 |
|
| 164 |
fcml_st_register fcml_reg_XMM16 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 165 |
fcml_st_register fcml_reg_YMM16 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 166 |
fcml_st_register fcml_reg_ZMM16 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 167 |
|
| 168 |
fcml_st_register fcml_reg_XMM17 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 169 |
fcml_st_register fcml_reg_YMM17 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 170 |
fcml_st_register fcml_reg_ZMM17 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 171 |
|
| 172 |
fcml_st_register fcml_reg_XMM18 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 173 |
fcml_st_register fcml_reg_YMM18 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 174 |
fcml_st_register fcml_reg_ZMM18 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 175 |
|
| 176 |
fcml_st_register fcml_reg_XMM19 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 177 |
fcml_st_register fcml_reg_YMM19 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 178 |
fcml_st_register fcml_reg_ZMM19 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 179 |
|
| 180 |
fcml_st_register fcml_reg_XMM20 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 181 |
fcml_st_register fcml_reg_YMM20 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 182 |
fcml_st_register fcml_reg_ZMM20 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 183 |
|
| 184 |
fcml_st_register fcml_reg_XMM21 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 185 |
fcml_st_register fcml_reg_YMM21 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 186 |
fcml_st_register fcml_reg_ZMM21 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 187 |
|
| 188 |
fcml_st_register fcml_reg_XMM22 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 189 |
fcml_st_register fcml_reg_YMM22 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 190 |
fcml_st_register fcml_reg_ZMM22 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 191 |
|
| 192 |
fcml_st_register fcml_reg_XMM23 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 193 |
fcml_st_register fcml_reg_YMM23 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 194 |
fcml_st_register fcml_reg_ZMM23 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 195 |
|
| 196 |
fcml_st_register fcml_reg_XMM24 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 197 |
fcml_st_register fcml_reg_YMM24 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 198 |
fcml_st_register fcml_reg_ZMM24 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 199 |
|
| 200 |
fcml_st_register fcml_reg_XMM25 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 201 |
fcml_st_register fcml_reg_YMM25 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 202 |
fcml_st_register fcml_reg_ZMM25 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 203 |
|
| 204 |
fcml_st_register fcml_reg_XMM26 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 205 |
fcml_st_register fcml_reg_YMM26 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 206 |
fcml_st_register fcml_reg_ZMM26 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 207 |
|
| 208 |
fcml_st_register fcml_reg_XMM27 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 209 |
fcml_st_register fcml_reg_YMM27 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 210 |
fcml_st_register fcml_reg_ZMM27 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 211 |
|
| 212 |
fcml_st_register fcml_reg_XMM28 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 213 |
fcml_st_register fcml_reg_YMM28 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 214 |
fcml_st_register fcml_reg_ZMM28 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 215 |
|
| 216 |
fcml_st_register fcml_reg_XMM29 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 217 |
fcml_st_register fcml_reg_YMM29 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 218 |
fcml_st_register fcml_reg_ZMM29 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 219 |
|
| 220 |
fcml_st_register fcml_reg_XMM30 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 221 |
fcml_st_register fcml_reg_YMM30 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 222 |
fcml_st_register fcml_reg_ZMM30 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 223 |
|
| 224 |
fcml_st_register fcml_reg_XMM31 = { FCML_REG_SIMD, FCML_DS_128, FCML_REG_XMM15, FCML_FALSE }; |
| 225 |
fcml_st_register fcml_reg_YMM31 = { FCML_REG_SIMD, FCML_DS_256, FCML_REG_YMM15, FCML_FALSE }; |
| 226 |
fcml_st_register fcml_reg_ZMM31 = { FCML_REG_SIMD, FCML_DS_512, FCML_REG_YMM0, FCML_FALSE }; |
| 227 |
|
| 228 |
fcml_st_register fcml_reg_ES = { FCML_REG_SEG, FCML_DS_16, FCML_REG_ES, FCML_FALSE }; |
| 229 |
fcml_st_register fcml_reg_CS = { FCML_REG_SEG, FCML_DS_16, FCML_REG_CS, FCML_FALSE }; |
| 230 |
fcml_st_register fcml_reg_SS = { FCML_REG_SEG, FCML_DS_16, FCML_REG_SS, FCML_FALSE }; |
| 231 |
fcml_st_register fcml_reg_DS = { FCML_REG_SEG, FCML_DS_16, FCML_REG_DS, FCML_FALSE }; |
| 232 |
fcml_st_register fcml_reg_FS = { FCML_REG_SEG, FCML_DS_16, FCML_REG_FS, FCML_FALSE }; |
| 233 |
fcml_st_register fcml_reg_GS = { FCML_REG_SEG, FCML_DS_16, FCML_REG_GS, FCML_FALSE }; |
| 234 |
|
| 235 |
fcml_st_register fcml_reg_ST0 = { FCML_REG_FPU, FCML_DS_UNDEF, FCML_REG_ST0, FCML_FALSE }; |
| 236 |
fcml_st_register fcml_reg_ST1 = { FCML_REG_FPU, FCML_DS_UNDEF, FCML_REG_ST1, FCML_FALSE }; |
| 237 |
fcml_st_register fcml_reg_ST2 = { FCML_REG_FPU, FCML_DS_UNDEF, FCML_REG_ST2, FCML_FALSE }; |
| 238 |
fcml_st_register fcml_reg_ST3 = { FCML_REG_FPU, FCML_DS_UNDEF, FCML_REG_ST3, FCML_FALSE }; |
| 239 |
fcml_st_register fcml_reg_ST4 = { FCML_REG_FPU, FCML_DS_UNDEF, FCML_REG_ST4, FCML_FALSE }; |
| 240 |
fcml_st_register fcml_reg_ST5 = { FCML_REG_FPU, FCML_DS_UNDEF, FCML_REG_ST5, FCML_FALSE }; |
| 241 |
fcml_st_register fcml_reg_ST6 = { FCML_REG_FPU, FCML_DS_UNDEF, FCML_REG_ST6, FCML_FALSE }; |
| 242 |
fcml_st_register fcml_reg_ST7 = { FCML_REG_FPU, FCML_DS_UNDEF, FCML_REG_ST7, FCML_FALSE }; |
| 243 |
|
| 244 |
fcml_st_register fcml_reg_CR0 = { FCML_REG_CR, FCML_DS_UNDEF, FCML_REG_CR0, FCML_FALSE }; |
| 245 |
fcml_st_register fcml_reg_CR2 = { FCML_REG_CR, FCML_DS_UNDEF, FCML_REG_CR2, FCML_FALSE }; |
| 246 |
fcml_st_register fcml_reg_CR3 = { FCML_REG_CR, FCML_DS_UNDEF, FCML_REG_CR3, FCML_FALSE }; |
| 247 |
fcml_st_register fcml_reg_CR4 = { FCML_REG_CR, FCML_DS_UNDEF, FCML_REG_CR4, FCML_FALSE }; |
| 248 |
fcml_st_register fcml_reg_CR8 = { FCML_REG_CR, FCML_DS_UNDEF, FCML_REG_CR8, FCML_FALSE }; |
| 249 |
|
| 250 |
fcml_st_register fcml_reg_DR0 = { FCML_REG_DR, FCML_DS_UNDEF, FCML_REG_DR0, FCML_FALSE }; |
| 251 |
fcml_st_register fcml_reg_DR1 = { FCML_REG_DR, FCML_DS_UNDEF, FCML_REG_DR1, FCML_FALSE }; |
| 252 |
fcml_st_register fcml_reg_DR2 = { FCML_REG_DR, FCML_DS_UNDEF, FCML_REG_DR2, FCML_FALSE }; |
| 253 |
fcml_st_register fcml_reg_DR3 = { FCML_REG_DR, FCML_DS_UNDEF, FCML_REG_DR3, FCML_FALSE }; |
| 254 |
fcml_st_register fcml_reg_DR4 = { FCML_REG_DR, FCML_DS_UNDEF, FCML_REG_DR4, FCML_FALSE }; |
| 255 |
fcml_st_register fcml_reg_DR5 = { FCML_REG_DR, FCML_DS_UNDEF, FCML_REG_DR5, FCML_FALSE }; |
| 256 |
fcml_st_register fcml_reg_DR6 = { FCML_REG_DR, FCML_DS_UNDEF, FCML_REG_DR6, FCML_FALSE }; |
| 257 |
fcml_st_register fcml_reg_DR7 = { FCML_REG_DR, FCML_DS_UNDEF, FCML_REG_DR7, FCML_FALSE }; |
| 258 |
|
| 259 |
fcml_st_register fcml_reg_K0 = { FCML_REG_OPMASK, FCML_DS_64, FCML_REG_K0, FCML_FALSE }; |
| 260 |
fcml_st_register fcml_reg_K1 = { FCML_REG_OPMASK, FCML_DS_64, FCML_REG_K1, FCML_FALSE }; |
| 261 |
fcml_st_register fcml_reg_K2 = { FCML_REG_OPMASK, FCML_DS_64, FCML_REG_K2, FCML_FALSE }; |
| 262 |
fcml_st_register fcml_reg_K3 = { FCML_REG_OPMASK, FCML_DS_64, FCML_REG_K3, FCML_FALSE }; |
| 263 |
fcml_st_register fcml_reg_K4 = { FCML_REG_OPMASK, FCML_DS_64, FCML_REG_K4, FCML_FALSE }; |
| 264 |
fcml_st_register fcml_reg_K5 = { FCML_REG_OPMASK, FCML_DS_64, FCML_REG_K5, FCML_FALSE }; |
| 265 |
fcml_st_register fcml_reg_K6 = { FCML_REG_OPMASK, FCML_DS_64, FCML_REG_K6, FCML_FALSE }; |
| 266 |
fcml_st_register fcml_reg_K7 = { FCML_REG_OPMASK, FCML_DS_64, FCML_REG_K7, FCML_FALSE }; |
| 267 |
|
| 268 |
fcml_st_register fcml_reg_IP = { FCML_REG_IP, FCML_DS_16, FCML_REG_UNDEFINED, FCML_FALSE }; |
| 269 |
fcml_st_register fcml_reg_EIP = { FCML_REG_IP, FCML_DS_32, FCML_REG_UNDEFINED, FCML_FALSE }; |
| 270 |
fcml_st_register fcml_reg_RIP = { FCML_REG_IP, FCML_DS_64, FCML_REG_UNDEFINED, FCML_FALSE }; |
| 271 |
|
| 272 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_8(fcml_uint8_t value) { |
| 273 |
fcml_st_operand imm = { FCML_OT_NONE }; |
| 274 |
imm.type = FCML_OT_IMMEDIATE; |
| 275 |
imm.immediate.size = FCML_DS_8; |
| 276 |
imm.immediate.int8 = value; |
| 277 |
return imm; |
| 278 |
} |
| 279 |
|
| 280 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_8(fcml_int8_t value) { |
| 281 |
fcml_st_operand imm = { FCML_OT_NONE }; |
| 282 |
imm.type = FCML_OT_IMMEDIATE; |
| 283 |
imm.immediate.size = FCML_DS_8; |
| 284 |
imm.immediate.is_signed = FCML_TRUE; |
| 285 |
imm.immediate.int8 = value; |
| 286 |
return imm; |
| 287 |
} |
| 288 |
|
| 289 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_16( |
| 290 |
fcml_uint16_t value) { |
| 291 |
fcml_st_operand imm = { FCML_OT_NONE }; |
| 292 |
imm.type = FCML_OT_IMMEDIATE; |
| 293 |
imm.immediate.size = FCML_DS_16; |
| 294 |
imm.immediate.int16 = value; |
| 295 |
return imm; |
| 296 |
} |
| 297 |
|
| 298 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_16(fcml_int16_t value) { |
| 299 |
fcml_st_operand imm = { FCML_OT_NONE }; |
| 300 |
imm.type = FCML_OT_IMMEDIATE; |
| 301 |
imm.immediate.size = FCML_DS_16; |
| 302 |
imm.immediate.is_signed = FCML_TRUE; |
| 303 |
imm.immediate.int16 = value; |
| 304 |
return imm; |
| 305 |
} |
| 306 |
|
| 307 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_32(fcml_uint32_t value) { |
| 308 |
fcml_st_operand imm = { FCML_OT_NONE }; |
| 309 |
imm.type = FCML_OT_IMMEDIATE; |
| 310 |
imm.immediate.size = FCML_DS_32; |
| 311 |
imm.immediate.int32 = value; |
| 312 |
return imm; |
| 313 |
} |
| 314 |
|
| 315 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_32(fcml_int32_t value) { |
| 316 |
fcml_st_operand imm = { FCML_OT_NONE }; |
| 317 |
imm.type = FCML_OT_IMMEDIATE; |
| 318 |
imm.immediate.size = FCML_DS_32; |
| 319 |
imm.immediate.is_signed = FCML_TRUE; |
| 320 |
imm.immediate.int32 = value; |
| 321 |
return imm; |
| 322 |
} |
| 323 |
|
| 324 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_unsigned_imm_64(fcml_uint64_t value) { |
| 325 |
fcml_st_operand imm = { FCML_OT_NONE }; |
| 326 |
imm.type = FCML_OT_IMMEDIATE; |
| 327 |
imm.immediate.size = FCML_DS_64; |
| 328 |
imm.immediate.int64 = value; |
| 329 |
return imm; |
| 330 |
} |
| 331 |
|
| 332 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_signed_imm_64(fcml_int64_t value) { |
| 333 |
fcml_st_operand imm = { FCML_OT_NONE }; |
| 334 |
imm.type = FCML_OT_IMMEDIATE; |
| 335 |
imm.immediate.size = FCML_DS_64; |
| 336 |
imm.immediate.is_signed = FCML_TRUE; |
| 337 |
imm.immediate.int64 = value; |
| 338 |
return imm; |
| 339 |
} |
| 340 |
|
| 341 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_reg(fcml_st_register *reg) { |
| 342 |
fcml_st_operand reg_operand = { FCML_OT_NONE }; |
| 343 |
reg_operand.type = FCML_OT_REGISTER; |
| 344 |
reg_operand.reg = *reg; |
| 345 |
return reg_operand; |
| 346 |
} |
| 347 |
|
| 348 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_far_pointer_offset16( |
| 349 |
fcml_int16_t seg, fcml_int16_t offset) { |
| 350 |
fcml_st_operand operand = { FCML_OT_NONE }; |
| 351 |
operand.type = FCML_OT_FAR_POINTER; |
| 352 |
fcml_st_far_pointer *far_pointer = &(operand.far_pointer); |
| 353 |
far_pointer->segment = seg; |
| 354 |
far_pointer->offset16 = offset; |
| 355 |
far_pointer->offset_size = FCML_DS_16; |
| 356 |
return operand; |
| 357 |
} |
| 358 |
|
| 359 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_far_pointer_offset32( |
| 360 |
fcml_int16_t seg, fcml_int32_t offset) { |
| 361 |
fcml_st_operand operand = { FCML_OT_NONE }; |
| 362 |
operand.type = FCML_OT_FAR_POINTER; |
| 363 |
fcml_st_far_pointer *far_pointer = &(operand.far_pointer); |
| 364 |
far_pointer->segment = seg; |
| 365 |
far_pointer->offset32 = offset; |
| 366 |
far_pointer->offset_size = FCML_DS_32; |
| 367 |
return operand; |
| 368 |
} |
| 369 |
|
| 370 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_offset_16(fcml_int16_t offset, |
| 371 |
fcml_usize size_operator) { |
| 372 |
fcml_st_operand operand = { FCML_OT_NONE }; |
| 373 |
operand.type = FCML_OT_ADDRESS; |
| 374 |
fcml_st_address *address = &(operand.address); |
| 375 |
address->address_form = FCML_AF_OFFSET; |
| 376 |
address->offset.off16 = offset; |
| 377 |
address->offset.size = FCML_DS_16; |
| 378 |
address->size_operator = size_operator; |
| 379 |
return operand; |
| 380 |
} |
| 381 |
|
| 382 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_offset_32(fcml_int32_t offset, |
| 383 |
fcml_usize size_operator) { |
| 384 |
fcml_st_operand operand = { FCML_OT_NONE }; |
| 385 |
operand.type = FCML_OT_ADDRESS; |
| 386 |
fcml_st_address *address = &(operand.address); |
| 387 |
address->address_form = FCML_AF_OFFSET; |
| 388 |
address->offset.off32 = offset; |
| 389 |
address->offset.size = FCML_DS_32; |
| 390 |
address->size_operator = size_operator; |
| 391 |
return operand; |
| 392 |
} |
| 393 |
|
| 394 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_offset_abs_64( |
| 395 |
fcml_int64_t offset, fcml_usize size_operator) { |
| 396 |
fcml_st_operand operand = { FCML_OT_NONE }; |
| 397 |
operand.type = FCML_OT_ADDRESS; |
| 398 |
fcml_st_address *address = &(operand.address); |
| 399 |
address->address_form = FCML_AF_OFFSET; |
| 400 |
address->offset.off64 = offset; |
| 401 |
address->offset.size = FCML_DS_64; |
| 402 |
address->size_operator = size_operator; |
| 403 |
operand.hints = FCML_OP_HINT_ABSOLUTE_ADDRESSING; |
| 404 |
return operand; |
| 405 |
} |
| 406 |
|
| 407 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_offset_rel_64( |
| 408 |
fcml_int64_t offset, fcml_usize size_operator) { |
| 409 |
fcml_st_operand operand = { FCML_OT_NONE }; |
| 410 |
operand.type = FCML_OT_ADDRESS; |
| 411 |
fcml_st_address *address = &(operand.address); |
| 412 |
address->address_form = FCML_AF_OFFSET; |
| 413 |
address->offset.off64 = offset; |
| 414 |
address->offset.size = FCML_DS_64; |
| 415 |
address->size_operator = size_operator; |
| 416 |
operand.hints = FCML_OP_HINT_RELATIVE_ADDRESSING; |
| 417 |
return operand; |
| 418 |
} |
| 419 |
|
| 420 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_disp_16(fcml_int16_t disp, |
| 421 |
fcml_usize size_operator) { |
| 422 |
fcml_st_operand operand = { FCML_OT_NONE }; |
| 423 |
operand.type = FCML_OT_ADDRESS; |
| 424 |
fcml_st_address *address = &(operand.address); |
| 425 |
fcml_st_effective_address *effective_address = &(address->effective_address); |
| 426 |
address->address_form = FCML_AF_COMBINED; |
| 427 |
address->size_operator = size_operator; |
| 428 |
effective_address->displacement.int16 = disp; |
| 429 |
effective_address->displacement.size = FCML_DS_16; |
| 430 |
return operand; |
| 431 |
} |
| 432 |
|
| 433 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_disp_32(fcml_int32_t disp, |
| 434 |
fcml_usize size_operator) { |
| 435 |
fcml_st_operand operand = { FCML_OT_NONE }; |
| 436 |
operand.type = FCML_OT_ADDRESS; |
| 437 |
fcml_st_address *address = &(operand.address); |
| 438 |
fcml_st_effective_address *effective_address = &(address->effective_address); |
| 439 |
address->address_form = FCML_AF_COMBINED; |
| 440 |
address->size_operator = size_operator; |
| 441 |
effective_address->displacement.int32 = disp; |
| 442 |
effective_address->displacement.size = FCML_DS_32; |
| 443 |
return operand; |
| 444 |
} |
| 445 |
|
| 446 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_disp_64(fcml_int64_t disp, |
| 447 |
fcml_usize size_operator) { |
| 448 |
fcml_st_operand operand = { FCML_OT_NONE }; |
| 449 |
operand.type = FCML_OT_ADDRESS; |
| 450 |
fcml_st_address *address = &(operand.address); |
| 451 |
fcml_st_effective_address *effective_address = &(address->effective_address); |
| 452 |
address->address_form = FCML_AF_COMBINED; |
| 453 |
address->size_operator = size_operator; |
| 454 |
effective_address->displacement.int64 = disp; |
| 455 |
effective_address->displacement.size = FCML_DS_64; |
| 456 |
return operand; |
| 457 |
} |
| 458 |
|
| 459 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_b_disp_8( |
| 460 |
fcml_st_register *base, fcml_int8_t disp, fcml_usize size_operator) { |
| 461 |
fcml_st_operand operand = { FCML_OT_NONE }; |
| 462 |
operand.type = FCML_OT_ADDRESS; |
| 463 |
fcml_st_address *address = &(operand.address); |
| 464 |
fcml_st_effective_address *effective_address = &(address->effective_address); |
| 465 |
address->address_form = FCML_AF_COMBINED; |
| 466 |
address->size_operator = size_operator; |
| 467 |
effective_address->displacement.int8 = disp; |
| 468 |
effective_address->displacement.size = FCML_DS_8; |
| 469 |
effective_address->base = *base; |
| 470 |
return operand; |
| 471 |
} |
| 472 |
|
| 473 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_b_disp_16( |
| 474 |
fcml_st_register *base, fcml_int16_t disp, fcml_usize size_operator) { |
| 475 |
fcml_st_operand operand = fcml_fn_cu_operand_addr_disp_16(disp, |
| 476 |
size_operator); |
| 477 |
operand.address.effective_address.base = *base; |
| 478 |
return operand; |
| 479 |
} |
| 480 |
|
| 481 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_b_disp_32( |
| 482 |
fcml_st_register *base, fcml_int32_t disp, fcml_usize size_operator) { |
| 483 |
fcml_st_operand operand = fcml_fn_cu_operand_addr_disp_32(disp, |
| 484 |
size_operator); |
| 485 |
operand.address.effective_address.base = *base; |
| 486 |
return operand; |
| 487 |
} |
| 488 |
|
| 489 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_b_disp_64( |
| 490 |
fcml_st_register *base, fcml_int64_t disp, fcml_usize size_operator) { |
| 491 |
fcml_st_operand operand = fcml_fn_cu_operand_addr_disp_64(disp, |
| 492 |
size_operator); |
| 493 |
operand.address.effective_address.base = *base; |
| 494 |
return operand; |
| 495 |
} |
| 496 |
|
| 497 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_is_disp_8( |
| 498 |
fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int8_t disp, |
| 499 |
fcml_usize size_operator) { |
| 500 |
fcml_st_operand operand = { FCML_OT_NONE }; |
| 501 |
operand.type = FCML_OT_ADDRESS; |
| 502 |
fcml_st_address *address = &(operand.address); |
| 503 |
fcml_st_effective_address *effective_address = |
| 504 |
&(address->effective_address); |
| 505 |
address->address_form = FCML_AF_COMBINED; |
| 506 |
address->size_operator = size_operator; |
| 507 |
effective_address->displacement.int8 = disp; |
| 508 |
effective_address->displacement.size = FCML_DS_8; |
| 509 |
effective_address->index = *index; |
| 510 |
effective_address->scale_factor = scale_factor; |
| 511 |
return operand; |
| 512 |
} |
| 513 |
|
| 514 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_is_disp_32( |
| 515 |
fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int32_t disp, |
| 516 |
fcml_usize size_operator) { |
| 517 |
fcml_st_operand operand = fcml_fn_cu_operand_addr_disp_32(disp, |
| 518 |
size_operator); |
| 519 |
fcml_st_effective_address *effective_address = |
| 520 |
&(operand.address.effective_address); |
| 521 |
effective_address->index = *index; |
| 522 |
effective_address->scale_factor = scale_factor; |
| 523 |
return operand; |
| 524 |
} |
| 525 |
|
| 526 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_is_disp_64( |
| 527 |
fcml_st_register *index, fcml_uint8_t scale_factor, fcml_int64_t disp, |
| 528 |
fcml_usize size_operator) { |
| 529 |
fcml_st_operand operand = fcml_fn_cu_operand_addr_disp_32( |
| 530 |
(fcml_int32_t) disp, size_operator); |
| 531 |
fcml_st_effective_address *effective_address = |
| 532 |
&(operand.address.effective_address); |
| 533 |
effective_address->index = *index; |
| 534 |
effective_address->scale_factor = scale_factor; |
| 535 |
return operand; |
| 536 |
} |
| 537 |
|
| 538 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_bis_disp_8( |
| 539 |
fcml_st_register *base, fcml_st_register *index, |
| 540 |
fcml_uint8_t scale_factor, fcml_int8_t disp, fcml_usize size_operator) { |
| 541 |
fcml_st_operand operand = { FCML_OT_NONE }; |
| 542 |
operand.type = FCML_OT_ADDRESS; |
| 543 |
fcml_st_address *address = &(operand.address); |
| 544 |
fcml_st_effective_address *effective_address = &(address->effective_address); |
| 545 |
address->address_form = FCML_AF_COMBINED; |
| 546 |
address->size_operator = size_operator; |
| 547 |
effective_address->displacement.int8 = disp; |
| 548 |
effective_address->displacement.size = FCML_DS_8; |
| 549 |
effective_address->base = *base; |
| 550 |
effective_address->index = *index; |
| 551 |
effective_address->scale_factor = scale_factor; |
| 552 |
return operand; |
| 553 |
} |
| 554 |
|
| 555 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_bis_disp_32( |
| 556 |
fcml_st_register *base, fcml_st_register *index, |
| 557 |
fcml_uint8_t scale_factor, fcml_int32_t disp, fcml_usize size_operator) { |
| 558 |
fcml_st_operand operand = fcml_fn_cu_operand_addr_disp_32(disp, |
| 559 |
size_operator); |
| 560 |
fcml_st_effective_address *effective_address = |
| 561 |
&(operand.address.effective_address); |
| 562 |
effective_address->base = *base; |
| 563 |
effective_address->index = *index; |
| 564 |
effective_address->scale_factor = scale_factor; |
| 565 |
return operand; |
| 566 |
} |
| 567 |
|
| 568 |
fcml_st_operand LIB_CALL fcml_fn_cu_operand_addr_bis_disp_64( |
| 569 |
fcml_st_register *base, fcml_st_register *index, |
| 570 |
fcml_uint8_t scale_factor, fcml_int64_t disp, fcml_usize size_operator) { |
| 571 |
fcml_st_operand operand = fcml_fn_cu_operand_addr_disp_32( |
| 572 |
(fcml_int32_t) disp, size_operator); |
| 573 |
fcml_st_effective_address *effective_address = |
| 574 |
&(operand.address.effective_address); |
| 575 |
effective_address->base = *base; |
| 576 |
effective_address->index = *index; |
| 577 |
effective_address->scale_factor = scale_factor; |
| 578 |
return operand; |
| 579 |
} |
| 580 |
|
| 581 |
fcml_st_operand LIB_CALL fcml_fn_cu_add_operand_hints(fcml_st_operand operand, |
| 582 |
fcml_hints hints) { |
| 583 |
operand.hints = hints; |
| 584 |
return operand; |
| 585 |
} |
| 586 |
|
| 587 |
fcml_st_instruction* LIB_CALL fcml_fn_cu_clone_instruction( |
| 588 |
fcml_st_instruction *instruction) { |
| 589 |
if (!instruction) { |
| 590 |
return NULL; |
| 591 |
} |
| 592 |
fcml_st_instruction *new_inst = |
| 593 |
(fcml_st_instruction*) fcml_fn_env_memory_alloc_clear( |
| 594 |
sizeof(fcml_st_instruction)); |
| 595 |
if (!new_inst) { |
| 596 |
return NULL; |
| 597 |
} |
| 598 |
*new_inst = *instruction; |
| 599 |
new_inst->mnemonic = fcml_fn_env_str_strdup(instruction->mnemonic); |
| 600 |
if (!new_inst->mnemonic) { |
| 601 |
fcml_fn_env_memory_free(new_inst); |
| 602 |
return NULL; |
| 603 |
} |
| 604 |
return new_inst; |
| 605 |
} |
| 606 |
|
| 607 |
void LIB_CALL fcml_fn_cu_free_instruction(fcml_st_instruction *instruction) { |
| 608 |
if (instruction) { |
| 609 |
if (instruction->mnemonic) { |
| 610 |
fcml_fn_env_str_strfree(instruction->mnemonic); |
| 611 |
} |
| 612 |
fcml_fn_env_memory_free(instruction); |
| 613 |
} |
| 614 |
} |
| 615 |
|
| 616 |
fcml_st_operand* fcml_fn_cu_find_operand(fcml_st_instruction *instruction, |
| 617 |
fcml_en_operand_type operand_type) { |
| 618 |
fcml_int i; |
| 619 |
for (i = 0; i < FCML_OPERANDS_COUNT; i++) { |
| 620 |
fcml_en_operand_type type = instruction->operands[i].type; |
| 621 |
if (type == operand_type) { |
| 622 |
return &(instruction->operands[i]); |
| 623 |
} else if (type == FCML_OT_NONE) { |
| 624 |
break; |
| 625 |
} |
| 626 |
} |
| 627 |
return NULL; |
| 628 |
} |