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