MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / bitR16

Method bitR16

tools/x86/src/x86/Bit.java:31–69  ·  view source on GitHub ↗
(FileOutputStream fos, FileOutputStream fos_init, FileOutputStream fos32, FileOutputStream fosOps_h, FileOutputStream fosOps_cpp, String functionName, String enumName, String op, boolean imm)

Source from the content-addressed store, hash-verified

29 }
30
31 public void bitR16(FileOutputStream fos, FileOutputStream fos_init, FileOutputStream fos32, FileOutputStream fosOps_h, FileOutputStream fosOps_cpp, String functionName, String enumName, String op, boolean imm) throws IOException {
32
33 if (imm) {
34 out(fosOps_h, "void common_"+functionName+"(CPU* cpu, U16 mask, U32 reg);");
35 out(fosOps_cpp, "void common_"+functionName+"(CPU* cpu, U16 mask, U32 reg) {");
36 } else {
37 out(fosOps_h, "void common_"+functionName+"(CPU* cpu, U32 maskReg, U32 reg);");
38 out(fosOps_cpp, "void common_"+functionName+"(CPU* cpu, U32 maskReg, U32 reg) {");
39 out(fosOps_cpp, " U16 mask=1 << (cpu->reg[maskReg].u16 & 15);");
40 }
41 out(fosOps_cpp, " cpu->fillFlagsNoCF();");
42 out(fosOps_cpp, " cpu->setCF(cpu->reg[reg].u16 & mask);");
43 if (op.length()>0) {
44 out(fosOps_cpp, " "+op);
45 }
46 out(fosOps_cpp, "}");
47
48 out(fos, "void OPCALL normal_"+functionName+"(CPU* cpu, DecodedOp* op) {");
49 out(fos, " START_OP(cpu, op);");
50 out(fos, " common_"+functionName+"(cpu, "+(imm?"op->imm":"op->rm")+", op->reg);");
51 out(fos, " NEXT();");
52 out(fos, "}");
53
54 out(fos_init, "INIT_CPU("+enumName+", "+functionName+")");
55
56 out(fos32, "void dynamic_"+functionName+"(DynamicData* data, DecodedOp* op) {");
57 if (imm) {
58 out(fos32, " callHostFunction(common_" + functionName + ", false, 3, 0, DYN_PARAM_CPU, false, op->imm, DYN_PARAM_CONST_16, false, op->reg, DYN_PARAM_CONST_32, false);");
59 } else {
60 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);");
61 }
62 out(fos32, " data->currentLazyFlags=FLAGS_NONE;");
63 out(fos32, " INCREMENT_EIP(op->len);");
64 out(fos32, "}");
65
66 if (!imm) {
67 bitR16(fos, fos_init, fos32, fosOps_h, fosOps_cpp, functionName.substring(0, functionName.length()-3), enumName.substring(0, enumName.length()-3), op, true);
68 }
69 }
70
71 public void bitE16(FileOutputStream fos, FileOutputStream fos_init, FileOutputStream fos32, FileOutputStream fosOps_h, FileOutputStream fosOps_cpp, String functionName, String enumName, String op, boolean imm) throws IOException {
72 if (imm) {

Callers 1

generateAllMethod · 0.95

Calls 2

outMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected