(FileOutputStream fos, FileOutputStream fos_init, FileOutputStream fos32, FileOutputStream fosOps_h, FileOutputStream fosOps_cpp, String functionName, String enumName, String op, boolean imm)
| 114 | } |
| 115 | |
| 116 | public void bitR32(FileOutputStream fos, FileOutputStream fos_init, FileOutputStream fos32, FileOutputStream fosOps_h, FileOutputStream fosOps_cpp, String functionName, String enumName, String op, boolean imm) throws IOException { |
| 117 | if (imm) { |
| 118 | out(fosOps_h, "void common_"+functionName+"(CPU* cpu, U32 mask, U32 reg);"); |
| 119 | out(fosOps_cpp, "void common_"+functionName+"(CPU* cpu, U32 mask, U32 reg) {"); |
| 120 | } else { |
| 121 | out(fosOps_h, "void common_"+functionName+"(CPU* cpu, U32 maskReg, U32 reg);"); |
| 122 | out(fosOps_cpp, "void common_"+functionName+"(CPU* cpu, U32 maskReg, U32 reg) {"); |
| 123 | out(fosOps_cpp, " U32 mask=1 << (cpu->reg[maskReg].u32 & 31);"); |
| 124 | } |
| 125 | out(fosOps_cpp, " cpu->fillFlagsNoCF();"); |
| 126 | out(fosOps_cpp, " cpu->setCF(cpu->reg[reg].u32 & mask);"); |
| 127 | if (op.length()>0) { |
| 128 | out(fosOps_cpp, " "+op); |
| 129 | } |
| 130 | out(fosOps_cpp, "}"); |
| 131 | |
| 132 | out(fos, "void OPCALL normal_"+functionName+"(CPU* cpu, DecodedOp* op) {"); |
| 133 | out(fos, " START_OP(cpu, op);"); |
| 134 | out(fos, " common_"+functionName+"(cpu, "+(imm?"op->imm":"op->rm")+", op->reg);"); |
| 135 | out(fos, " NEXT();"); |
| 136 | out(fos, "}"); |
| 137 | |
| 138 | out(fos_init, "INIT_CPU("+enumName+", "+functionName+")"); |
| 139 | |
| 140 | out(fos32, "void dynamic_"+functionName+"(DynamicData* data, DecodedOp* op) {"); |
| 141 | if (imm) { |
| 142 | out(fos32, " callHostFunction(common_" + functionName + ", false, 3, 0, DYN_PARAM_CPU, false, op->imm, DYN_PARAM_CONST_32, false, op->reg, DYN_PARAM_CONST_32, false);"); |
| 143 | } else { |
| 144 | out(fos32, " callHostFunction(common_" + functionName + ", false, 3, 0, DYN_PARAM_CPU, false, op->rm, DYN_PARAM_CONST_32, false, op->reg, DYN_PARAM_CONST_32, false);"); |
| 145 | } |
| 146 | out(fos32, " data->currentLazyFlags=FLAGS_NONE;"); |
| 147 | out(fos32, " INCREMENT_EIP(op->len);"); |
| 148 | out(fos32, "}"); |
| 149 | |
| 150 | if (!imm) { |
| 151 | bitR32(fos, fos_init, fos32, fosOps_h, fosOps_cpp, functionName.substring(0, functionName.length()-3), enumName.substring(0, enumName.length()-3), op, true); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | public void bitE32(FileOutputStream fos, FileOutputStream fos_init, FileOutputStream fos32, FileOutputStream fosOps_h, FileOutputStream fosOps_cpp, String functionName, String enumName, String op, boolean imm) throws IOException { |
| 156 | if (imm) { |
no test coverage detected