translate.c (f003dd8d81f7d88f4b1f8802309eaa76f6eb223a) translate.c (905a83dedf62a230adbfb7d66b9cf20ab044ab68)
1/*
2 SPARC translation
3
4 Copyright (C) 2003 Thomas M. Ogrisegg <tom@fnord.at>
5 Copyright (C) 2003-2005 Fabrice Bellard
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public

--- 2824 unchanged lines hidden (view full) ---

2833 tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl_tmp);
2834 }
2835}
2836#endif
2837
2838static void gen_edge(DisasContext *dc, TCGv dst, TCGv s1, TCGv s2,
2839 int width, bool cc, bool left)
2840{
1/*
2 SPARC translation
3
4 Copyright (C) 2003 Thomas M. Ogrisegg <tom@fnord.at>
5 Copyright (C) 2003-2005 Fabrice Bellard
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public

--- 2824 unchanged lines hidden (view full) ---

2833 tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl_tmp);
2834 }
2835}
2836#endif
2837
2838static void gen_edge(DisasContext *dc, TCGv dst, TCGv s1, TCGv s2,
2839 int width, bool cc, bool left)
2840{
2841 TCGv lo1, lo2, t1, t2;
2841 TCGv lo1, lo2;
2842 uint64_t amask, tabl, tabr;
2843 int shift, imask, omask;
2844
2845 if (cc) {
2846 tcg_gen_mov_tl(cpu_cc_src, s1);
2847 tcg_gen_mov_tl(cpu_cc_src2, s2);
2848 tcg_gen_sub_tl(cpu_cc_dst, s1, s2);
2849 tcg_gen_movi_i32(cpu_cc_op, CC_OP_SUB);

--- 50 unchanged lines hidden (view full) ---

2900
2901 lo1 = tcg_temp_new();
2902 lo2 = tcg_temp_new();
2903 tcg_gen_andi_tl(lo1, s1, imask);
2904 tcg_gen_andi_tl(lo2, s2, imask);
2905 tcg_gen_shli_tl(lo1, lo1, shift);
2906 tcg_gen_shli_tl(lo2, lo2, shift);
2907
2842 uint64_t amask, tabl, tabr;
2843 int shift, imask, omask;
2844
2845 if (cc) {
2846 tcg_gen_mov_tl(cpu_cc_src, s1);
2847 tcg_gen_mov_tl(cpu_cc_src2, s2);
2848 tcg_gen_sub_tl(cpu_cc_dst, s1, s2);
2849 tcg_gen_movi_i32(cpu_cc_op, CC_OP_SUB);

--- 50 unchanged lines hidden (view full) ---

2900
2901 lo1 = tcg_temp_new();
2902 lo2 = tcg_temp_new();
2903 tcg_gen_andi_tl(lo1, s1, imask);
2904 tcg_gen_andi_tl(lo2, s2, imask);
2905 tcg_gen_shli_tl(lo1, lo1, shift);
2906 tcg_gen_shli_tl(lo2, lo2, shift);
2907
2908 t1 = tcg_const_tl(tabl);
2909 t2 = tcg_const_tl(tabr);
2910 tcg_gen_shr_tl(lo1, t1, lo1);
2911 tcg_gen_shr_tl(lo2, t2, lo2);
2908 tcg_gen_shr_tl(lo1, tcg_constant_tl(tabl), lo1);
2909 tcg_gen_shr_tl(lo2, tcg_constant_tl(tabr), lo2);
2912 tcg_gen_andi_tl(dst, lo1, omask);
2913 tcg_gen_andi_tl(lo2, lo2, omask);
2914
2915 amask = -8;
2916 if (AM_CHECK(dc)) {
2917 amask &= 0xffffffffULL;
2918 }
2919 tcg_gen_andi_tl(s1, s1, amask);
2920 tcg_gen_andi_tl(s2, s2, amask);
2921
2922 /* We want to compute
2923 dst = (s1 == s2 ? lo1 : lo1 & lo2).
2924 We've already done dst = lo1, so this reduces to
2925 dst &= (s1 == s2 ? -1 : lo2)
2926 Which we perform by
2927 lo2 |= -(s1 == s2)
2928 dst &= lo2
2929 */
2910 tcg_gen_andi_tl(dst, lo1, omask);
2911 tcg_gen_andi_tl(lo2, lo2, omask);
2912
2913 amask = -8;
2914 if (AM_CHECK(dc)) {
2915 amask &= 0xffffffffULL;
2916 }
2917 tcg_gen_andi_tl(s1, s1, amask);
2918 tcg_gen_andi_tl(s2, s2, amask);
2919
2920 /* We want to compute
2921 dst = (s1 == s2 ? lo1 : lo1 & lo2).
2922 We've already done dst = lo1, so this reduces to
2923 dst &= (s1 == s2 ? -1 : lo2)
2924 Which we perform by
2925 lo2 |= -(s1 == s2)
2926 dst &= lo2
2927 */
2930 tcg_gen_setcond_tl(TCG_COND_EQ, t1, s1, s2);
2931 tcg_gen_neg_tl(t1, t1);
2932 tcg_gen_or_tl(lo2, lo2, t1);
2928 tcg_gen_setcond_tl(TCG_COND_EQ, lo1, s1, s2);
2929 tcg_gen_neg_tl(lo1, lo1);
2930 tcg_gen_or_tl(lo2, lo2, lo1);
2933 tcg_gen_and_tl(dst, dst, lo2);
2934}
2935
2936static void gen_alignaddr(TCGv dst, TCGv s1, TCGv s2, bool left)
2937{
2938 TCGv tmp = tcg_temp_new();
2939
2940 tcg_gen_add_tl(tmp, s1, s2);

--- 2876 unchanged lines hidden ---
2931 tcg_gen_and_tl(dst, dst, lo2);
2932}
2933
2934static void gen_alignaddr(TCGv dst, TCGv s1, TCGv s2, bool left)
2935{
2936 TCGv tmp = tcg_temp_new();
2937
2938 tcg_gen_add_tl(tmp, s1, s2);

--- 2876 unchanged lines hidden ---