Commit ee6c0b51e97c8bcad32181f42e63765b18c30354
1 parent
48dc41eb
sparc branch fix (Blue Swirl)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1999 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
5 additions
and
5 deletions
target-sparc/translate.c
@@ -956,8 +956,8 @@ static void disas_sparc_insn(DisasContext * dc) | @@ -956,8 +956,8 @@ static void disas_sparc_insn(DisasContext * dc) | ||
956 | int cc; | 956 | int cc; |
957 | 957 | ||
958 | target = GET_FIELD_SP(insn, 0, 18); | 958 | target = GET_FIELD_SP(insn, 0, 18); |
959 | - target <<= 2; | ||
960 | target = sign_extend(target, 18); | 959 | target = sign_extend(target, 18); |
960 | + target <<= 2; | ||
961 | cc = GET_FIELD_SP(insn, 20, 21); | 961 | cc = GET_FIELD_SP(insn, 20, 21); |
962 | if (cc == 0) | 962 | if (cc == 0) |
963 | do_branch(dc, target, insn, 0); | 963 | do_branch(dc, target, insn, 0); |
@@ -971,8 +971,8 @@ static void disas_sparc_insn(DisasContext * dc) | @@ -971,8 +971,8 @@ static void disas_sparc_insn(DisasContext * dc) | ||
971 | { | 971 | { |
972 | target = GET_FIELD_SP(insn, 0, 13) | | 972 | target = GET_FIELD_SP(insn, 0, 13) | |
973 | (GET_FIELD_SP(insn, 20, 21) >> 7); | 973 | (GET_FIELD_SP(insn, 20, 21) >> 7); |
974 | - target <<= 2; | ||
975 | target = sign_extend(target, 16); | 974 | target = sign_extend(target, 16); |
975 | + target <<= 2; | ||
976 | rs1 = GET_FIELD(insn, 13, 17); | 976 | rs1 = GET_FIELD(insn, 13, 17); |
977 | gen_movl_reg_T0(rs1); | 977 | gen_movl_reg_T0(rs1); |
978 | do_branch_reg(dc, target, insn); | 978 | do_branch_reg(dc, target, insn); |
@@ -986,8 +986,8 @@ static void disas_sparc_insn(DisasContext * dc) | @@ -986,8 +986,8 @@ static void disas_sparc_insn(DisasContext * dc) | ||
986 | gen_op_trap_ifnofpu(); | 986 | gen_op_trap_ifnofpu(); |
987 | #endif | 987 | #endif |
988 | target = GET_FIELD_SP(insn, 0, 18); | 988 | target = GET_FIELD_SP(insn, 0, 18); |
989 | - target <<= 2; | ||
990 | target = sign_extend(target, 19); | 989 | target = sign_extend(target, 19); |
990 | + target <<= 2; | ||
991 | do_fbranch(dc, target, insn, cc); | 991 | do_fbranch(dc, target, insn, cc); |
992 | goto jmp_insn; | 992 | goto jmp_insn; |
993 | } | 993 | } |
@@ -995,8 +995,8 @@ static void disas_sparc_insn(DisasContext * dc) | @@ -995,8 +995,8 @@ static void disas_sparc_insn(DisasContext * dc) | ||
995 | case 0x2: /* BN+x */ | 995 | case 0x2: /* BN+x */ |
996 | { | 996 | { |
997 | target = GET_FIELD(insn, 10, 31); | 997 | target = GET_FIELD(insn, 10, 31); |
998 | - target <<= 2; | ||
999 | target = sign_extend(target, 22); | 998 | target = sign_extend(target, 22); |
999 | + target <<= 2; | ||
1000 | do_branch(dc, target, insn, 0); | 1000 | do_branch(dc, target, insn, 0); |
1001 | goto jmp_insn; | 1001 | goto jmp_insn; |
1002 | } | 1002 | } |
@@ -1007,8 +1007,8 @@ static void disas_sparc_insn(DisasContext * dc) | @@ -1007,8 +1007,8 @@ static void disas_sparc_insn(DisasContext * dc) | ||
1007 | gen_op_trap_ifnofpu(); | 1007 | gen_op_trap_ifnofpu(); |
1008 | #endif | 1008 | #endif |
1009 | target = GET_FIELD(insn, 10, 31); | 1009 | target = GET_FIELD(insn, 10, 31); |
1010 | - target <<= 2; | ||
1011 | target = sign_extend(target, 22); | 1010 | target = sign_extend(target, 22); |
1011 | + target <<= 2; | ||
1012 | do_fbranch(dc, target, insn, 0); | 1012 | do_fbranch(dc, target, insn, 0); |
1013 | goto jmp_insn; | 1013 | goto jmp_insn; |
1014 | } | 1014 | } |