xref: /openbmc/qemu/target/i386/helper.h (revision 29318db1)
1 DEF_HELPER_FLAGS_4(cc_compute_all, TCG_CALL_NO_RWG_SE, tl, tl, tl, tl, int)
2 DEF_HELPER_FLAGS_4(cc_compute_c, TCG_CALL_NO_RWG_SE, tl, tl, tl, tl, int)
3 
4 DEF_HELPER_3(write_eflags, void, env, tl, i32)
5 DEF_HELPER_1(read_eflags, tl, env)
6 DEF_HELPER_2(divb_AL, void, env, tl)
7 DEF_HELPER_2(idivb_AL, void, env, tl)
8 DEF_HELPER_2(divw_AX, void, env, tl)
9 DEF_HELPER_2(idivw_AX, void, env, tl)
10 DEF_HELPER_2(divl_EAX, void, env, tl)
11 DEF_HELPER_2(idivl_EAX, void, env, tl)
12 #ifdef TARGET_X86_64
13 DEF_HELPER_2(divq_EAX, void, env, tl)
14 DEF_HELPER_2(idivq_EAX, void, env, tl)
15 #endif
16 DEF_HELPER_FLAGS_2(cr4_testbit, TCG_CALL_NO_WG, void, env, i32)
17 
18 DEF_HELPER_FLAGS_2(bndck, TCG_CALL_NO_WG, void, env, i32)
19 DEF_HELPER_FLAGS_3(bndldx32, TCG_CALL_NO_WG, i64, env, tl, tl)
20 DEF_HELPER_FLAGS_3(bndldx64, TCG_CALL_NO_WG, i64, env, tl, tl)
21 DEF_HELPER_FLAGS_5(bndstx32, TCG_CALL_NO_WG, void, env, tl, tl, i64, i64)
22 DEF_HELPER_FLAGS_5(bndstx64, TCG_CALL_NO_WG, void, env, tl, tl, i64, i64)
23 DEF_HELPER_1(bnd_jmp, void, env)
24 
25 DEF_HELPER_FLAGS_2(aam, TCG_CALL_NO_RWG_SE, tl, tl, tl)
26 DEF_HELPER_FLAGS_2(aad, TCG_CALL_NO_RWG_SE, tl, tl, tl)
27 DEF_HELPER_1(aaa, void, env)
28 DEF_HELPER_1(aas, void, env)
29 DEF_HELPER_1(daa, void, env)
30 DEF_HELPER_1(das, void, env)
31 
32 DEF_HELPER_2(lsl, tl, env, tl)
33 DEF_HELPER_2(lar, tl, env, tl)
34 DEF_HELPER_2(verr, void, env, tl)
35 DEF_HELPER_2(verw, void, env, tl)
36 DEF_HELPER_2(lldt, void, env, int)
37 DEF_HELPER_2(ltr, void, env, int)
38 DEF_HELPER_3(load_seg, void, env, int, int)
39 DEF_HELPER_4(ljmp_protected, void, env, int, tl, tl)
40 DEF_HELPER_5(lcall_real, void, env, i32, i32, int, i32)
41 DEF_HELPER_5(lcall_protected, void, env, int, tl, int, tl)
42 DEF_HELPER_2(iret_real, void, env, int)
43 DEF_HELPER_3(iret_protected, void, env, int, int)
44 DEF_HELPER_3(lret_protected, void, env, int, int)
45 DEF_HELPER_1(clts, void, env)
46 
47 #ifndef CONFIG_USER_ONLY
48 DEF_HELPER_FLAGS_3(set_dr, TCG_CALL_NO_WG, void, env, int, tl)
49 DEF_HELPER_FLAGS_2(get_dr, TCG_CALL_NO_WG, tl, env, int)
50 #endif /* !CONFIG_USER_ONLY */
51 
52 DEF_HELPER_1(sysenter, void, env)
53 DEF_HELPER_2(sysexit, void, env, int)
54 DEF_HELPER_2(syscall, void, env, int)
55 DEF_HELPER_2(sysret, void, env, int)
56 DEF_HELPER_FLAGS_1(pause, TCG_CALL_NO_WG, noreturn, env)
57 DEF_HELPER_FLAGS_3(raise_interrupt, TCG_CALL_NO_WG, noreturn, env, int, int)
58 DEF_HELPER_FLAGS_2(raise_exception, TCG_CALL_NO_WG, noreturn, env, int)
59 DEF_HELPER_FLAGS_1(icebp, TCG_CALL_NO_WG, noreturn, env)
60 DEF_HELPER_3(boundw, void, env, tl, int)
61 DEF_HELPER_3(boundl, void, env, tl, int)
62 
63 #ifndef CONFIG_USER_ONLY
64 DEF_HELPER_1(rsm, void, env)
65 #endif /* !CONFIG_USER_ONLY */
66 
67 DEF_HELPER_2(into, void, env, int)
68 DEF_HELPER_FLAGS_1(single_step, TCG_CALL_NO_WG, noreturn, env)
69 DEF_HELPER_1(rechecking_single_step, void, env)
70 DEF_HELPER_1(cpuid, void, env)
71 DEF_HELPER_FLAGS_1(rdpid, TCG_CALL_NO_WG, tl, env)
72 DEF_HELPER_1(rdtsc, void, env)
73 DEF_HELPER_FLAGS_1(rdpmc, TCG_CALL_NO_WG, noreturn, env)
74 
75 #ifndef CONFIG_USER_ONLY
76 DEF_HELPER_3(outb, void, env, i32, i32)
77 DEF_HELPER_2(inb, tl, env, i32)
78 DEF_HELPER_3(outw, void, env, i32, i32)
79 DEF_HELPER_2(inw, tl, env, i32)
80 DEF_HELPER_3(outl, void, env, i32, i32)
81 DEF_HELPER_2(inl, tl, env, i32)
82 DEF_HELPER_FLAGS_3(check_io, TCG_CALL_NO_WG, void, env, i32, i32)
83 DEF_HELPER_FLAGS_4(bpt_io, TCG_CALL_NO_WG, void, env, i32, i32, tl)
84 DEF_HELPER_2(svm_check_intercept, void, env, i32)
85 DEF_HELPER_4(svm_check_io, void, env, i32, i32, i32)
86 DEF_HELPER_3(vmrun, void, env, int, int)
87 DEF_HELPER_1(vmmcall, void, env)
88 DEF_HELPER_2(vmload, void, env, int)
89 DEF_HELPER_2(vmsave, void, env, int)
90 DEF_HELPER_1(stgi, void, env)
91 DEF_HELPER_1(clgi, void, env)
92 DEF_HELPER_FLAGS_2(flush_page, TCG_CALL_NO_RWG, void, env, tl)
93 DEF_HELPER_FLAGS_1(hlt, TCG_CALL_NO_WG, noreturn, env)
94 DEF_HELPER_FLAGS_2(monitor, TCG_CALL_NO_WG, void, env, tl)
95 DEF_HELPER_FLAGS_2(mwait, TCG_CALL_NO_WG, noreturn, env, int)
96 DEF_HELPER_1(rdmsr, void, env)
97 DEF_HELPER_1(wrmsr, void, env)
98 DEF_HELPER_FLAGS_1(read_cr8, TCG_CALL_NO_RWG, tl, env)
99 DEF_HELPER_FLAGS_3(write_crN, TCG_CALL_NO_RWG, void, env, int, tl)
100 #endif /* !CONFIG_USER_ONLY */
101 
102 /* x86 FPU */
103 
104 DEF_HELPER_2(flds_FT0, void, env, i32)
105 DEF_HELPER_2(fldl_FT0, void, env, i64)
106 DEF_HELPER_2(fildl_FT0, void, env, s32)
107 DEF_HELPER_2(flds_ST0, void, env, i32)
108 DEF_HELPER_2(fldl_ST0, void, env, i64)
109 DEF_HELPER_2(fildl_ST0, void, env, s32)
110 DEF_HELPER_2(fildll_ST0, void, env, s64)
111 DEF_HELPER_1(fsts_ST0, i32, env)
112 DEF_HELPER_1(fstl_ST0, i64, env)
113 DEF_HELPER_1(fist_ST0, s32, env)
114 DEF_HELPER_1(fistl_ST0, s32, env)
115 DEF_HELPER_1(fistll_ST0, s64, env)
116 DEF_HELPER_1(fistt_ST0, s32, env)
117 DEF_HELPER_1(fisttl_ST0, s32, env)
118 DEF_HELPER_1(fisttll_ST0, s64, env)
119 DEF_HELPER_2(fldt_ST0, void, env, tl)
120 DEF_HELPER_2(fstt_ST0, void, env, tl)
121 DEF_HELPER_1(fpush, void, env)
122 DEF_HELPER_1(fpop, void, env)
123 DEF_HELPER_1(fdecstp, void, env)
124 DEF_HELPER_1(fincstp, void, env)
125 DEF_HELPER_2(ffree_STN, void, env, int)
126 DEF_HELPER_1(fmov_ST0_FT0, void, env)
127 DEF_HELPER_2(fmov_FT0_STN, void, env, int)
128 DEF_HELPER_2(fmov_ST0_STN, void, env, int)
129 DEF_HELPER_2(fmov_STN_ST0, void, env, int)
130 DEF_HELPER_2(fxchg_ST0_STN, void, env, int)
131 DEF_HELPER_1(fcom_ST0_FT0, void, env)
132 DEF_HELPER_1(fucom_ST0_FT0, void, env)
133 DEF_HELPER_1(fcomi_ST0_FT0, void, env)
134 DEF_HELPER_1(fucomi_ST0_FT0, void, env)
135 DEF_HELPER_1(fadd_ST0_FT0, void, env)
136 DEF_HELPER_1(fmul_ST0_FT0, void, env)
137 DEF_HELPER_1(fsub_ST0_FT0, void, env)
138 DEF_HELPER_1(fsubr_ST0_FT0, void, env)
139 DEF_HELPER_1(fdiv_ST0_FT0, void, env)
140 DEF_HELPER_1(fdivr_ST0_FT0, void, env)
141 DEF_HELPER_2(fadd_STN_ST0, void, env, int)
142 DEF_HELPER_2(fmul_STN_ST0, void, env, int)
143 DEF_HELPER_2(fsub_STN_ST0, void, env, int)
144 DEF_HELPER_2(fsubr_STN_ST0, void, env, int)
145 DEF_HELPER_2(fdiv_STN_ST0, void, env, int)
146 DEF_HELPER_2(fdivr_STN_ST0, void, env, int)
147 DEF_HELPER_1(fchs_ST0, void, env)
148 DEF_HELPER_1(fabs_ST0, void, env)
149 DEF_HELPER_1(fxam_ST0, void, env)
150 DEF_HELPER_1(fld1_ST0, void, env)
151 DEF_HELPER_1(fldl2t_ST0, void, env)
152 DEF_HELPER_1(fldl2e_ST0, void, env)
153 DEF_HELPER_1(fldpi_ST0, void, env)
154 DEF_HELPER_1(fldlg2_ST0, void, env)
155 DEF_HELPER_1(fldln2_ST0, void, env)
156 DEF_HELPER_1(fldz_ST0, void, env)
157 DEF_HELPER_1(fldz_FT0, void, env)
158 DEF_HELPER_1(fnstsw, i32, env)
159 DEF_HELPER_1(fnstcw, i32, env)
160 DEF_HELPER_2(fldcw, void, env, i32)
161 DEF_HELPER_1(fclex, void, env)
162 DEF_HELPER_1(fwait, void, env)
163 DEF_HELPER_1(fninit, void, env)
164 DEF_HELPER_2(fbld_ST0, void, env, tl)
165 DEF_HELPER_2(fbst_ST0, void, env, tl)
166 DEF_HELPER_1(f2xm1, void, env)
167 DEF_HELPER_1(fyl2x, void, env)
168 DEF_HELPER_1(fptan, void, env)
169 DEF_HELPER_1(fpatan, void, env)
170 DEF_HELPER_1(fxtract, void, env)
171 DEF_HELPER_1(fprem1, void, env)
172 DEF_HELPER_1(fprem, void, env)
173 DEF_HELPER_1(fyl2xp1, void, env)
174 DEF_HELPER_1(fsqrt, void, env)
175 DEF_HELPER_1(fsincos, void, env)
176 DEF_HELPER_1(frndint, void, env)
177 DEF_HELPER_1(fscale, void, env)
178 DEF_HELPER_1(fsin, void, env)
179 DEF_HELPER_1(fcos, void, env)
180 DEF_HELPER_3(fstenv, void, env, tl, int)
181 DEF_HELPER_3(fldenv, void, env, tl, int)
182 DEF_HELPER_3(fsave, void, env, tl, int)
183 DEF_HELPER_3(frstor, void, env, tl, int)
184 DEF_HELPER_FLAGS_2(fxsave, TCG_CALL_NO_WG, void, env, tl)
185 DEF_HELPER_FLAGS_2(fxrstor, TCG_CALL_NO_WG, void, env, tl)
186 DEF_HELPER_FLAGS_3(xsave, TCG_CALL_NO_WG, void, env, tl, i64)
187 DEF_HELPER_FLAGS_3(xsaveopt, TCG_CALL_NO_WG, void, env, tl, i64)
188 DEF_HELPER_FLAGS_3(xrstor, TCG_CALL_NO_WG, void, env, tl, i64)
189 DEF_HELPER_FLAGS_2(xgetbv, TCG_CALL_NO_WG, i64, env, i32)
190 DEF_HELPER_FLAGS_3(xsetbv, TCG_CALL_NO_WG, void, env, i32, i64)
191 DEF_HELPER_FLAGS_2(rdpkru, TCG_CALL_NO_WG, i64, env, i32)
192 DEF_HELPER_FLAGS_3(wrpkru, TCG_CALL_NO_WG, void, env, i32, i64)
193 
194 DEF_HELPER_FLAGS_2(pdep, TCG_CALL_NO_RWG_SE, tl, tl, tl)
195 DEF_HELPER_FLAGS_2(pext, TCG_CALL_NO_RWG_SE, tl, tl, tl)
196 
197 /* MMX/SSE */
198 
199 DEF_HELPER_2(ldmxcsr, void, env, i32)
200 DEF_HELPER_1(update_mxcsr, void, env)
201 DEF_HELPER_1(enter_mmx, void, env)
202 DEF_HELPER_1(emms, void, env)
203 
204 #define SHIFT 0
205 #include "tcg/ops_sse_header.h.inc"
206 #define SHIFT 1
207 #include "tcg/ops_sse_header.h.inc"
208 #define SHIFT 2
209 #include "tcg/ops_sse_header.h.inc"
210 
211 DEF_HELPER_1(rdrand, tl, env)
212