pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 1 | #include "def-helper.h" |
bellard | b5b38f6 | 2008-05-12 22:05:13 +0000 | [diff] [blame] | 2 | |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 3 | DEF_HELPER_FLAGS_1(cc_compute_all, TCG_CALL_PURE, i32, int) |
| 4 | DEF_HELPER_FLAGS_1(cc_compute_c, TCG_CALL_PURE, i32, int) |
| 5 | |
| 6 | DEF_HELPER_0(lock, void) |
| 7 | DEF_HELPER_0(unlock, void) |
| 8 | DEF_HELPER_2(write_eflags, void, tl, i32) |
| 9 | DEF_HELPER_0(read_eflags, tl) |
| 10 | DEF_HELPER_1(divb_AL, void, tl) |
| 11 | DEF_HELPER_1(idivb_AL, void, tl) |
| 12 | DEF_HELPER_1(divw_AX, void, tl) |
| 13 | DEF_HELPER_1(idivw_AX, void, tl) |
| 14 | DEF_HELPER_1(divl_EAX, void, tl) |
| 15 | DEF_HELPER_1(idivl_EAX, void, tl) |
bellard | 437a88a | 2008-05-22 16:11:04 +0000 | [diff] [blame] | 16 | #ifdef TARGET_X86_64 |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 17 | DEF_HELPER_1(mulq_EAX_T0, void, tl) |
| 18 | DEF_HELPER_1(imulq_EAX_T0, void, tl) |
| 19 | DEF_HELPER_2(imulq_T0_T1, tl, tl, tl) |
| 20 | DEF_HELPER_1(divq_EAX, void, tl) |
| 21 | DEF_HELPER_1(idivq_EAX, void, tl) |
bellard | 437a88a | 2008-05-22 16:11:04 +0000 | [diff] [blame] | 22 | #endif |
bellard | b5b38f6 | 2008-05-12 22:05:13 +0000 | [diff] [blame] | 23 | |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 24 | DEF_HELPER_1(aam, void, int) |
| 25 | DEF_HELPER_1(aad, void, int) |
| 26 | DEF_HELPER_0(aaa, void) |
| 27 | DEF_HELPER_0(aas, void) |
| 28 | DEF_HELPER_0(daa, void) |
| 29 | DEF_HELPER_0(das, void) |
bellard | 437a88a | 2008-05-22 16:11:04 +0000 | [diff] [blame] | 30 | |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 31 | DEF_HELPER_1(lsl, tl, tl) |
| 32 | DEF_HELPER_1(lar, tl, tl) |
| 33 | DEF_HELPER_1(verr, void, tl) |
| 34 | DEF_HELPER_1(verw, void, tl) |
| 35 | DEF_HELPER_1(lldt, void, int) |
| 36 | DEF_HELPER_1(ltr, void, int) |
| 37 | DEF_HELPER_2(load_seg, void, int, int) |
| 38 | DEF_HELPER_3(ljmp_protected, void, int, tl, int) |
| 39 | DEF_HELPER_4(lcall_real, void, int, tl, int, int) |
| 40 | DEF_HELPER_4(lcall_protected, void, int, tl, int, int) |
| 41 | DEF_HELPER_1(iret_real, void, int) |
| 42 | DEF_HELPER_2(iret_protected, void, int, int) |
| 43 | DEF_HELPER_2(lret_protected, void, int, int) |
| 44 | DEF_HELPER_1(read_crN, tl, int) |
| 45 | DEF_HELPER_2(write_crN, void, int, tl) |
| 46 | DEF_HELPER_1(lmsw, void, tl) |
| 47 | DEF_HELPER_0(clts, void) |
| 48 | DEF_HELPER_2(movl_drN_T0, void, int, tl) |
| 49 | DEF_HELPER_1(invlpg, void, tl) |
bellard | b5b38f6 | 2008-05-12 22:05:13 +0000 | [diff] [blame] | 50 | |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 51 | DEF_HELPER_3(enter_level, void, int, int, tl) |
bellard | b5b38f6 | 2008-05-12 22:05:13 +0000 | [diff] [blame] | 52 | #ifdef TARGET_X86_64 |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 53 | DEF_HELPER_3(enter64_level, void, int, int, tl) |
bellard | b5b38f6 | 2008-05-12 22:05:13 +0000 | [diff] [blame] | 54 | #endif |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 55 | DEF_HELPER_0(sysenter, void) |
| 56 | DEF_HELPER_1(sysexit, void, int) |
bellard | b5b38f6 | 2008-05-12 22:05:13 +0000 | [diff] [blame] | 57 | #ifdef TARGET_X86_64 |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 58 | DEF_HELPER_1(syscall, void, int) |
| 59 | DEF_HELPER_1(sysret, void, int) |
bellard | b5b38f6 | 2008-05-12 22:05:13 +0000 | [diff] [blame] | 60 | #endif |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 61 | DEF_HELPER_1(hlt, void, int) |
| 62 | DEF_HELPER_1(monitor, void, tl) |
| 63 | DEF_HELPER_1(mwait, void, int) |
| 64 | DEF_HELPER_0(debug, void) |
Jan Kiszka | a239780 | 2009-05-10 22:30:53 +0200 | [diff] [blame] | 65 | DEF_HELPER_0(reset_rf, void) |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 66 | DEF_HELPER_2(raise_interrupt, void, int, int) |
| 67 | DEF_HELPER_1(raise_exception, void, int) |
| 68 | DEF_HELPER_0(cli, void) |
| 69 | DEF_HELPER_0(sti, void) |
| 70 | DEF_HELPER_0(set_inhibit_irq, void) |
| 71 | DEF_HELPER_0(reset_inhibit_irq, void) |
| 72 | DEF_HELPER_2(boundw, void, tl, int) |
| 73 | DEF_HELPER_2(boundl, void, tl, int) |
| 74 | DEF_HELPER_0(rsm, void) |
| 75 | DEF_HELPER_1(into, void, int) |
| 76 | DEF_HELPER_1(cmpxchg8b, void, tl) |
bellard | 1b9d9eb | 2008-05-22 09:52:38 +0000 | [diff] [blame] | 77 | #ifdef TARGET_X86_64 |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 78 | DEF_HELPER_1(cmpxchg16b, void, tl) |
bellard | 1b9d9eb | 2008-05-22 09:52:38 +0000 | [diff] [blame] | 79 | #endif |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 80 | DEF_HELPER_0(single_step, void) |
| 81 | DEF_HELPER_0(cpuid, void) |
| 82 | DEF_HELPER_0(rdtsc, void) |
| 83 | DEF_HELPER_0(rdpmc, void) |
| 84 | DEF_HELPER_0(rdmsr, void) |
| 85 | DEF_HELPER_0(wrmsr, void) |
bellard | b5b38f6 | 2008-05-12 22:05:13 +0000 | [diff] [blame] | 86 | |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 87 | DEF_HELPER_1(check_iob, void, i32) |
| 88 | DEF_HELPER_1(check_iow, void, i32) |
| 89 | DEF_HELPER_1(check_iol, void, i32) |
| 90 | DEF_HELPER_2(outb, void, i32, i32) |
| 91 | DEF_HELPER_1(inb, tl, i32) |
| 92 | DEF_HELPER_2(outw, void, i32, i32) |
| 93 | DEF_HELPER_1(inw, tl, i32) |
| 94 | DEF_HELPER_2(outl, void, i32, i32) |
| 95 | DEF_HELPER_1(inl, tl, i32) |
bellard | b8b6a50 | 2008-05-15 16:46:30 +0000 | [diff] [blame] | 96 | |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 97 | DEF_HELPER_2(svm_check_intercept_param, void, i32, i64) |
| 98 | DEF_HELPER_2(vmexit, void, i32, i64) |
| 99 | DEF_HELPER_3(svm_check_io, void, i32, i32, i32) |
| 100 | DEF_HELPER_2(vmrun, void, int, int) |
| 101 | DEF_HELPER_0(vmmcall, void) |
| 102 | DEF_HELPER_1(vmload, void, int) |
| 103 | DEF_HELPER_1(vmsave, void, int) |
| 104 | DEF_HELPER_0(stgi, void) |
| 105 | DEF_HELPER_0(clgi, void) |
| 106 | DEF_HELPER_0(skinit, void) |
| 107 | DEF_HELPER_1(invlpga, void, int) |
bellard | 19e6c4b | 2008-05-12 19:10:44 +0000 | [diff] [blame] | 108 | |
| 109 | /* x86 FPU */ |
| 110 | |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 111 | DEF_HELPER_1(flds_FT0, void, i32) |
| 112 | DEF_HELPER_1(fldl_FT0, void, i64) |
| 113 | DEF_HELPER_1(fildl_FT0, void, s32) |
| 114 | DEF_HELPER_1(flds_ST0, void, i32) |
| 115 | DEF_HELPER_1(fldl_ST0, void, i64) |
| 116 | DEF_HELPER_1(fildl_ST0, void, s32) |
| 117 | DEF_HELPER_1(fildll_ST0, void, s64) |
| 118 | DEF_HELPER_0(fsts_ST0, i32) |
| 119 | DEF_HELPER_0(fstl_ST0, i64) |
| 120 | DEF_HELPER_0(fist_ST0, s32) |
| 121 | DEF_HELPER_0(fistl_ST0, s32) |
| 122 | DEF_HELPER_0(fistll_ST0, s64) |
| 123 | DEF_HELPER_0(fistt_ST0, s32) |
| 124 | DEF_HELPER_0(fisttl_ST0, s32) |
| 125 | DEF_HELPER_0(fisttll_ST0, s64) |
| 126 | DEF_HELPER_1(fldt_ST0, void, tl) |
| 127 | DEF_HELPER_1(fstt_ST0, void, tl) |
| 128 | DEF_HELPER_0(fpush, void) |
| 129 | DEF_HELPER_0(fpop, void) |
| 130 | DEF_HELPER_0(fdecstp, void) |
| 131 | DEF_HELPER_0(fincstp, void) |
| 132 | DEF_HELPER_1(ffree_STN, void, int) |
| 133 | DEF_HELPER_0(fmov_ST0_FT0, void) |
| 134 | DEF_HELPER_1(fmov_FT0_STN, void, int) |
| 135 | DEF_HELPER_1(fmov_ST0_STN, void, int) |
| 136 | DEF_HELPER_1(fmov_STN_ST0, void, int) |
| 137 | DEF_HELPER_1(fxchg_ST0_STN, void, int) |
| 138 | DEF_HELPER_0(fcom_ST0_FT0, void) |
| 139 | DEF_HELPER_0(fucom_ST0_FT0, void) |
| 140 | DEF_HELPER_0(fcomi_ST0_FT0, void) |
| 141 | DEF_HELPER_0(fucomi_ST0_FT0, void) |
| 142 | DEF_HELPER_0(fadd_ST0_FT0, void) |
| 143 | DEF_HELPER_0(fmul_ST0_FT0, void) |
| 144 | DEF_HELPER_0(fsub_ST0_FT0, void) |
| 145 | DEF_HELPER_0(fsubr_ST0_FT0, void) |
| 146 | DEF_HELPER_0(fdiv_ST0_FT0, void) |
| 147 | DEF_HELPER_0(fdivr_ST0_FT0, void) |
| 148 | DEF_HELPER_1(fadd_STN_ST0, void, int) |
| 149 | DEF_HELPER_1(fmul_STN_ST0, void, int) |
| 150 | DEF_HELPER_1(fsub_STN_ST0, void, int) |
| 151 | DEF_HELPER_1(fsubr_STN_ST0, void, int) |
| 152 | DEF_HELPER_1(fdiv_STN_ST0, void, int) |
| 153 | DEF_HELPER_1(fdivr_STN_ST0, void, int) |
| 154 | DEF_HELPER_0(fchs_ST0, void) |
| 155 | DEF_HELPER_0(fabs_ST0, void) |
| 156 | DEF_HELPER_0(fxam_ST0, void) |
| 157 | DEF_HELPER_0(fld1_ST0, void) |
| 158 | DEF_HELPER_0(fldl2t_ST0, void) |
| 159 | DEF_HELPER_0(fldl2e_ST0, void) |
| 160 | DEF_HELPER_0(fldpi_ST0, void) |
| 161 | DEF_HELPER_0(fldlg2_ST0, void) |
| 162 | DEF_HELPER_0(fldln2_ST0, void) |
| 163 | DEF_HELPER_0(fldz_ST0, void) |
| 164 | DEF_HELPER_0(fldz_FT0, void) |
| 165 | DEF_HELPER_0(fnstsw, i32) |
| 166 | DEF_HELPER_0(fnstcw, i32) |
| 167 | DEF_HELPER_1(fldcw, void, i32) |
| 168 | DEF_HELPER_0(fclex, void) |
| 169 | DEF_HELPER_0(fwait, void) |
| 170 | DEF_HELPER_0(fninit, void) |
| 171 | DEF_HELPER_1(fbld_ST0, void, tl) |
| 172 | DEF_HELPER_1(fbst_ST0, void, tl) |
| 173 | DEF_HELPER_0(f2xm1, void) |
| 174 | DEF_HELPER_0(fyl2x, void) |
| 175 | DEF_HELPER_0(fptan, void) |
| 176 | DEF_HELPER_0(fpatan, void) |
| 177 | DEF_HELPER_0(fxtract, void) |
| 178 | DEF_HELPER_0(fprem1, void) |
| 179 | DEF_HELPER_0(fprem, void) |
| 180 | DEF_HELPER_0(fyl2xp1, void) |
| 181 | DEF_HELPER_0(fsqrt, void) |
| 182 | DEF_HELPER_0(fsincos, void) |
| 183 | DEF_HELPER_0(frndint, void) |
| 184 | DEF_HELPER_0(fscale, void) |
| 185 | DEF_HELPER_0(fsin, void) |
| 186 | DEF_HELPER_0(fcos, void) |
| 187 | DEF_HELPER_2(fstenv, void, tl, int) |
| 188 | DEF_HELPER_2(fldenv, void, tl, int) |
| 189 | DEF_HELPER_2(fsave, void, tl, int) |
| 190 | DEF_HELPER_2(frstor, void, tl, int) |
| 191 | DEF_HELPER_2(fxsave, void, tl, int) |
| 192 | DEF_HELPER_2(fxrstor, void, tl, int) |
| 193 | DEF_HELPER_1(bsf, tl, tl) |
| 194 | DEF_HELPER_1(bsr, tl, tl) |
bellard | 19e6c4b | 2008-05-12 19:10:44 +0000 | [diff] [blame] | 195 | |
| 196 | /* MMX/SSE */ |
| 197 | |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 198 | DEF_HELPER_0(enter_mmx, void) |
| 199 | DEF_HELPER_0(emms, void) |
| 200 | DEF_HELPER_2(movq, void, ptr, ptr) |
bellard | 5af4518 | 2008-05-12 16:47:36 +0000 | [diff] [blame] | 201 | |
| 202 | #define SHIFT 0 |
| 203 | #include "ops_sse_header.h" |
| 204 | #define SHIFT 1 |
| 205 | #include "ops_sse_header.h" |
| 206 | |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 207 | DEF_HELPER_2(rclb, tl, tl, tl) |
| 208 | DEF_HELPER_2(rclw, tl, tl, tl) |
| 209 | DEF_HELPER_2(rcll, tl, tl, tl) |
| 210 | DEF_HELPER_2(rcrb, tl, tl, tl) |
| 211 | DEF_HELPER_2(rcrw, tl, tl, tl) |
| 212 | DEF_HELPER_2(rcrl, tl, tl, tl) |
bellard | b6abf97 | 2008-05-17 12:44:31 +0000 | [diff] [blame] | 213 | #ifdef TARGET_X86_64 |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 214 | DEF_HELPER_2(rclq, tl, tl, tl) |
| 215 | DEF_HELPER_2(rcrq, tl, tl, tl) |
bellard | b6abf97 | 2008-05-17 12:44:31 +0000 | [diff] [blame] | 216 | #endif |
| 217 | |
pbrook | a7812ae | 2008-11-17 14:43:54 +0000 | [diff] [blame] | 218 | #include "def-helper.h" |