blob: b8f1e78c752e48bad838277d2d73c2c40c000aff [file] [log] [blame]
blueswir11a2fb1c2008-02-24 14:10:06 +00001#ifndef TARGET_SPARC64
Blue Swirl063c3672011-07-03 21:01:59 +00002DEF_HELPER_1(rett, void, env)
3DEF_HELPER_2(wrpsr, void, env, tl)
4DEF_HELPER_1(rdpsr, tl, env)
Ronald Hechtd1c36ba2013-02-19 12:45:07 +01005DEF_HELPER_1(power_down, void, env)
blueswir11a2fb1c2008-02-24 14:10:06 +00006#else
Richard Hendersonbe72f9f2015-08-19 09:43:01 -07007DEF_HELPER_FLAGS_2(wrpil, TCG_CALL_NO_RWG, void, env, tl)
Artyom Tarasenkocbc3a6a2016-06-07 18:34:49 +02008DEF_HELPER_2(wrgl, void, env, tl)
Blue Swirl063c3672011-07-03 21:01:59 +00009DEF_HELPER_2(wrpstate, void, env, tl)
10DEF_HELPER_1(done, void, env)
11DEF_HELPER_1(retry, void, env)
Richard Hendersonbe72f9f2015-08-19 09:43:01 -070012DEF_HELPER_FLAGS_1(flushw, TCG_CALL_NO_WG, void, env)
13DEF_HELPER_FLAGS_1(saved, TCG_CALL_NO_RWG, void, env)
14DEF_HELPER_FLAGS_1(restored, TCG_CALL_NO_RWG, void, env)
Blue Swirl063c3672011-07-03 21:01:59 +000015DEF_HELPER_1(rdccr, tl, env)
16DEF_HELPER_2(wrccr, void, env, tl)
17DEF_HELPER_1(rdcwp, tl, env)
18DEF_HELPER_2(wrcwp, void, env, tl)
Aurelien Jarnoc33b2352012-10-09 21:53:09 +020019DEF_HELPER_FLAGS_2(array8, TCG_CALL_NO_RWG_SE, tl, tl, tl)
Richard Hendersone86ceb02015-08-19 09:58:17 -070020DEF_HELPER_FLAGS_2(set_softint, TCG_CALL_NO_RWG, void, env, i64)
21DEF_HELPER_FLAGS_2(clear_softint, TCG_CALL_NO_RWG, void, env, i64)
22DEF_HELPER_FLAGS_2(write_softint, TCG_CALL_NO_RWG, void, env, i64)
Richard Hendersonbe72f9f2015-08-19 09:43:01 -070023DEF_HELPER_FLAGS_2(tick_set_count, TCG_CALL_NO_RWG, void, ptr, i64)
24DEF_HELPER_FLAGS_3(tick_get_count, TCG_CALL_NO_WG, i64, env, ptr, int)
25DEF_HELPER_FLAGS_2(tick_set_limit, TCG_CALL_NO_RWG, void, ptr, i64)
blueswir11a2fb1c2008-02-24 14:10:06 +000026#endif
Richard Hendersonbe72f9f2015-08-19 09:43:01 -070027DEF_HELPER_FLAGS_3(check_align, TCG_CALL_NO_WG, void, env, tl, i32)
Blue Swirlbc265312011-07-03 08:19:42 +000028DEF_HELPER_1(debug, void, env)
Blue Swirl063c3672011-07-03 21:01:59 +000029DEF_HELPER_1(save, void, env)
30DEF_HELPER_1(restore, void, env)
Blue Swirl7a5e4482011-07-04 18:15:42 +000031DEF_HELPER_3(udiv, tl, env, tl, tl)
32DEF_HELPER_3(udiv_cc, tl, env, tl, tl)
33DEF_HELPER_3(sdiv, tl, env, tl, tl)
34DEF_HELPER_3(sdiv_cc, tl, env, tl, tl)
Richard Hendersona2ea4aa2012-10-05 16:55:05 -070035DEF_HELPER_3(taddcctv, tl, env, tl, tl)
36DEF_HELPER_3(tsubcctv, tl, env, tl, tl)
Richard Hendersonc28ae412012-10-05 16:55:03 -070037#ifdef TARGET_SPARC64
Richard Hendersonbe72f9f2015-08-19 09:43:01 -070038DEF_HELPER_FLAGS_3(sdivx, TCG_CALL_NO_WG, s64, env, s64, s64)
39DEF_HELPER_FLAGS_3(udivx, TCG_CALL_NO_WG, i64, env, i64, i64)
Richard Hendersonc28ae412012-10-05 16:55:03 -070040#endif
blueswir1c9e03d82008-05-22 18:16:25 +000041#if !defined(CONFIG_USER_ONLY) || defined(TARGET_SPARC64)
Richard Henderson68508112015-09-03 13:37:09 -070042DEF_HELPER_FLAGS_4(ld_asi, TCG_CALL_NO_WG, i64, env, tl, int, i32)
43DEF_HELPER_FLAGS_5(st_asi, TCG_CALL_NO_WG, void, env, tl, i64, int, i32)
blueswir1c9e03d82008-05-22 18:16:25 +000044#endif
Richard Henderson7385aed2015-09-09 11:11:36 -070045DEF_HELPER_FLAGS_1(check_ieee_exceptions, TCG_CALL_NO_WG, tl, env)
46DEF_HELPER_FLAGS_3(ldfsr, TCG_CALL_NO_RWG, tl, env, tl, i32)
Aurelien Jarnoc33b2352012-10-09 21:53:09 +020047DEF_HELPER_FLAGS_1(fabss, TCG_CALL_NO_RWG_SE, f32, f32)
Richard Henderson7385aed2015-09-09 11:11:36 -070048DEF_HELPER_FLAGS_2(fsqrts, TCG_CALL_NO_RWG, f32, env, f32)
49DEF_HELPER_FLAGS_2(fsqrtd, TCG_CALL_NO_RWG, f64, env, f64)
50DEF_HELPER_FLAGS_3(fcmps, TCG_CALL_NO_WG, tl, env, f32, f32)
51DEF_HELPER_FLAGS_3(fcmpd, TCG_CALL_NO_WG, tl, env, f64, f64)
52DEF_HELPER_FLAGS_3(fcmpes, TCG_CALL_NO_WG, tl, env, f32, f32)
53DEF_HELPER_FLAGS_3(fcmped, TCG_CALL_NO_WG, tl, env, f64, f64)
54DEF_HELPER_FLAGS_1(fsqrtq, TCG_CALL_NO_RWG, void, env)
55DEF_HELPER_FLAGS_1(fcmpq, TCG_CALL_NO_WG, tl, env)
56DEF_HELPER_FLAGS_1(fcmpeq, TCG_CALL_NO_WG, tl, env)
blueswir17e8c2b62008-03-04 20:00:18 +000057#ifdef TARGET_SPARC64
Richard Henderson7385aed2015-09-09 11:11:36 -070058DEF_HELPER_FLAGS_3(ldxfsr, TCG_CALL_NO_RWG, tl, env, tl, i64)
Aurelien Jarnoc33b2352012-10-09 21:53:09 +020059DEF_HELPER_FLAGS_1(fabsd, TCG_CALL_NO_RWG_SE, f64, f64)
Richard Henderson7385aed2015-09-09 11:11:36 -070060DEF_HELPER_FLAGS_3(fcmps_fcc1, TCG_CALL_NO_WG, tl, env, f32, f32)
61DEF_HELPER_FLAGS_3(fcmps_fcc2, TCG_CALL_NO_WG, tl, env, f32, f32)
62DEF_HELPER_FLAGS_3(fcmps_fcc3, TCG_CALL_NO_WG, tl, env, f32, f32)
63DEF_HELPER_FLAGS_3(fcmpd_fcc1, TCG_CALL_NO_WG, tl, env, f64, f64)
64DEF_HELPER_FLAGS_3(fcmpd_fcc2, TCG_CALL_NO_WG, tl, env, f64, f64)
65DEF_HELPER_FLAGS_3(fcmpd_fcc3, TCG_CALL_NO_WG, tl, env, f64, f64)
66DEF_HELPER_FLAGS_3(fcmpes_fcc1, TCG_CALL_NO_WG, tl, env, f32, f32)
67DEF_HELPER_FLAGS_3(fcmpes_fcc2, TCG_CALL_NO_WG, tl, env, f32, f32)
68DEF_HELPER_FLAGS_3(fcmpes_fcc3, TCG_CALL_NO_WG, tl, env, f32, f32)
69DEF_HELPER_FLAGS_3(fcmped_fcc1, TCG_CALL_NO_WG, tl, env, f64, f64)
70DEF_HELPER_FLAGS_3(fcmped_fcc2, TCG_CALL_NO_WG, tl, env, f64, f64)
71DEF_HELPER_FLAGS_3(fcmped_fcc3, TCG_CALL_NO_WG, tl, env, f64, f64)
Richard Hendersonbe72f9f2015-08-19 09:43:01 -070072DEF_HELPER_FLAGS_1(fabsq, TCG_CALL_NO_RWG, void, env)
Richard Henderson7385aed2015-09-09 11:11:36 -070073DEF_HELPER_FLAGS_1(fcmpq_fcc1, TCG_CALL_NO_WG, tl, env)
74DEF_HELPER_FLAGS_1(fcmpq_fcc2, TCG_CALL_NO_WG, tl, env)
75DEF_HELPER_FLAGS_1(fcmpq_fcc3, TCG_CALL_NO_WG, tl, env)
76DEF_HELPER_FLAGS_1(fcmpeq_fcc1, TCG_CALL_NO_WG, tl, env)
77DEF_HELPER_FLAGS_1(fcmpeq_fcc2, TCG_CALL_NO_WG, tl, env)
78DEF_HELPER_FLAGS_1(fcmpeq_fcc3, TCG_CALL_NO_WG, tl, env)
blueswir17e8c2b62008-03-04 20:00:18 +000079#endif
Stefan Weilbc098452012-03-18 23:16:04 +010080DEF_HELPER_2(raise_exception, noreturn, env, int)
Richard Henderson7385aed2015-09-09 11:11:36 -070081#define F_HELPER_0_1(name) \
82 DEF_HELPER_FLAGS_1(f ## name, TCG_CALL_NO_RWG, void, env)
blueswir144e77572008-03-21 17:56:02 +000083
Richard Henderson7385aed2015-09-09 11:11:36 -070084DEF_HELPER_FLAGS_3(faddd, TCG_CALL_NO_RWG, f64, env, f64, f64)
85DEF_HELPER_FLAGS_3(fsubd, TCG_CALL_NO_RWG, f64, env, f64, f64)
86DEF_HELPER_FLAGS_3(fmuld, TCG_CALL_NO_RWG, f64, env, f64, f64)
87DEF_HELPER_FLAGS_3(fdivd, TCG_CALL_NO_RWG, f64, env, f64, f64)
Richard Henderson03fb8cf2011-10-15 10:20:20 -070088F_HELPER_0_1(addq)
89F_HELPER_0_1(subq)
90F_HELPER_0_1(mulq)
91F_HELPER_0_1(divq)
blueswir1714547b2008-09-10 19:54:51 +000092
Richard Henderson7385aed2015-09-09 11:11:36 -070093DEF_HELPER_FLAGS_3(fadds, TCG_CALL_NO_RWG, f32, env, f32, f32)
94DEF_HELPER_FLAGS_3(fsubs, TCG_CALL_NO_RWG, f32, env, f32, f32)
95DEF_HELPER_FLAGS_3(fmuls, TCG_CALL_NO_RWG, f32, env, f32, f32)
96DEF_HELPER_FLAGS_3(fdivs, TCG_CALL_NO_RWG, f32, env, f32, f32)
blueswir144e77572008-03-21 17:56:02 +000097
Richard Henderson7385aed2015-09-09 11:11:36 -070098DEF_HELPER_FLAGS_3(fsmuld, TCG_CALL_NO_RWG, f64, env, f32, f32)
99DEF_HELPER_FLAGS_3(fdmulq, TCG_CALL_NO_RWG, void, env, f64, f64)
blueswir144e77572008-03-21 17:56:02 +0000100
Aurelien Jarnoc33b2352012-10-09 21:53:09 +0200101DEF_HELPER_FLAGS_1(fnegs, TCG_CALL_NO_RWG_SE, f32, f32)
Richard Hendersonbe72f9f2015-08-19 09:43:01 -0700102DEF_HELPER_FLAGS_2(fitod, TCG_CALL_NO_RWG_SE, f64, env, s32)
103DEF_HELPER_FLAGS_2(fitoq, TCG_CALL_NO_RWG, void, env, s32)
blueswir1714547b2008-09-10 19:54:51 +0000104
Richard Henderson7385aed2015-09-09 11:11:36 -0700105DEF_HELPER_FLAGS_2(fitos, TCG_CALL_NO_RWG, f32, env, s32)
blueswir1714547b2008-09-10 19:54:51 +0000106
blueswir144e77572008-03-21 17:56:02 +0000107#ifdef TARGET_SPARC64
Aurelien Jarnoc33b2352012-10-09 21:53:09 +0200108DEF_HELPER_FLAGS_1(fnegd, TCG_CALL_NO_RWG_SE, f64, f64)
Richard Hendersonbe72f9f2015-08-19 09:43:01 -0700109DEF_HELPER_FLAGS_1(fnegq, TCG_CALL_NO_RWG, void, env)
Richard Henderson7385aed2015-09-09 11:11:36 -0700110DEF_HELPER_FLAGS_2(fxtos, TCG_CALL_NO_RWG, f32, env, s64)
111DEF_HELPER_FLAGS_2(fxtod, TCG_CALL_NO_RWG, f64, env, s64)
Richard Hendersonbe72f9f2015-08-19 09:43:01 -0700112DEF_HELPER_FLAGS_2(fxtoq, TCG_CALL_NO_RWG, void, env, s64)
blueswir144e77572008-03-21 17:56:02 +0000113#endif
Richard Henderson7385aed2015-09-09 11:11:36 -0700114DEF_HELPER_FLAGS_2(fdtos, TCG_CALL_NO_RWG, f32, env, f64)
115DEF_HELPER_FLAGS_2(fstod, TCG_CALL_NO_RWG, f64, env, f32)
116DEF_HELPER_FLAGS_1(fqtos, TCG_CALL_NO_RWG, f32, env)
117DEF_HELPER_FLAGS_2(fstoq, TCG_CALL_NO_RWG, void, env, f32)
118DEF_HELPER_FLAGS_1(fqtod, TCG_CALL_NO_RWG, f64, env)
119DEF_HELPER_FLAGS_2(fdtoq, TCG_CALL_NO_RWG, void, env, f64)
120DEF_HELPER_FLAGS_2(fstoi, TCG_CALL_NO_RWG, s32, env, f32)
121DEF_HELPER_FLAGS_2(fdtoi, TCG_CALL_NO_RWG, s32, env, f64)
122DEF_HELPER_FLAGS_1(fqtoi, TCG_CALL_NO_RWG, s32, env)
blueswir144e77572008-03-21 17:56:02 +0000123#ifdef TARGET_SPARC64
Richard Henderson7385aed2015-09-09 11:11:36 -0700124DEF_HELPER_FLAGS_2(fstox, TCG_CALL_NO_RWG, s64, env, f32)
125DEF_HELPER_FLAGS_2(fdtox, TCG_CALL_NO_RWG, s64, env, f64)
126DEF_HELPER_FLAGS_1(fqtox, TCG_CALL_NO_RWG, s64, env)
blueswir1c9e03d82008-05-22 18:16:25 +0000127
Aurelien Jarnoc33b2352012-10-09 21:53:09 +0200128DEF_HELPER_FLAGS_2(fpmerge, TCG_CALL_NO_RWG_SE, i64, i64, i64)
129DEF_HELPER_FLAGS_2(fmul8x16, TCG_CALL_NO_RWG_SE, i64, i64, i64)
130DEF_HELPER_FLAGS_2(fmul8x16al, TCG_CALL_NO_RWG_SE, i64, i64, i64)
131DEF_HELPER_FLAGS_2(fmul8x16au, TCG_CALL_NO_RWG_SE, i64, i64, i64)
132DEF_HELPER_FLAGS_2(fmul8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64)
133DEF_HELPER_FLAGS_2(fmul8ulx16, TCG_CALL_NO_RWG_SE, i64, i64, i64)
134DEF_HELPER_FLAGS_2(fmuld8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64)
135DEF_HELPER_FLAGS_2(fmuld8ulx16, TCG_CALL_NO_RWG_SE, i64, i64, i64)
136DEF_HELPER_FLAGS_2(fexpand, TCG_CALL_NO_RWG_SE, i64, i64, i64)
137DEF_HELPER_FLAGS_3(pdist, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64)
138DEF_HELPER_FLAGS_2(fpack16, TCG_CALL_NO_RWG_SE, i32, i64, i64)
139DEF_HELPER_FLAGS_3(fpack32, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64)
140DEF_HELPER_FLAGS_2(fpackfix, TCG_CALL_NO_RWG_SE, i32, i64, i64)
141DEF_HELPER_FLAGS_3(bshuffle, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64)
Richard Hendersonf027c3b2011-10-19 14:56:43 -0700142#define VIS_HELPER(name) \
Aurelien Jarnoc33b2352012-10-09 21:53:09 +0200143 DEF_HELPER_FLAGS_2(f ## name ## 16, TCG_CALL_NO_RWG_SE, \
Richard Hendersonf027c3b2011-10-19 14:56:43 -0700144 i64, i64, i64) \
Aurelien Jarnoc33b2352012-10-09 21:53:09 +0200145 DEF_HELPER_FLAGS_2(f ## name ## 16s, TCG_CALL_NO_RWG_SE, \
Richard Hendersonf027c3b2011-10-19 14:56:43 -0700146 i32, i32, i32) \
Aurelien Jarnoc33b2352012-10-09 21:53:09 +0200147 DEF_HELPER_FLAGS_2(f ## name ## 32, TCG_CALL_NO_RWG_SE, \
Richard Hendersonf027c3b2011-10-19 14:56:43 -0700148 i64, i64, i64) \
Aurelien Jarnoc33b2352012-10-09 21:53:09 +0200149 DEF_HELPER_FLAGS_2(f ## name ## 32s, TCG_CALL_NO_RWG_SE, \
Richard Hendersonf027c3b2011-10-19 14:56:43 -0700150 i32, i32, i32)
blueswir144e77572008-03-21 17:56:02 +0000151
Richard Hendersonf5daeec2013-09-14 15:38:30 -0700152VIS_HELPER(padd)
153VIS_HELPER(psub)
Richard Hendersonf027c3b2011-10-19 14:56:43 -0700154#define VIS_CMPHELPER(name) \
Aurelien Jarnoc33b2352012-10-09 21:53:09 +0200155 DEF_HELPER_FLAGS_2(f##name##16, TCG_CALL_NO_RWG_SE, \
Richard Hendersonf027c3b2011-10-19 14:56:43 -0700156 i64, i64, i64) \
Aurelien Jarnoc33b2352012-10-09 21:53:09 +0200157 DEF_HELPER_FLAGS_2(f##name##32, TCG_CALL_NO_RWG_SE, \
Richard Hendersonf027c3b2011-10-19 14:56:43 -0700158 i64, i64, i64)
Richard Hendersonf5daeec2013-09-14 15:38:30 -0700159VIS_CMPHELPER(cmpgt)
160VIS_CMPHELPER(cmpeq)
161VIS_CMPHELPER(cmple)
162VIS_CMPHELPER(cmpne)
blueswir144e77572008-03-21 17:56:02 +0000163#endif
Blue Swirl2e2f4ad2011-07-03 10:42:23 +0000164#undef F_HELPER_0_1
blueswir144e77572008-03-21 17:56:02 +0000165#undef VIS_HELPER
166#undef VIS_CMPHELPER
Richard Hendersonf5daeec2013-09-14 15:38:30 -0700167DEF_HELPER_1(compute_psr, void, env)
Richard Hendersonbe72f9f2015-08-19 09:43:01 -0700168DEF_HELPER_FLAGS_1(compute_C_icc, TCG_CALL_NO_WG_SE, i32, env)