diff options
author | Chao-ying Fu <fu@mips.com> | 2013-10-18 21:14:25 +0000 |
---|---|---|
committer | Chao-ying Fu <fu@mips.com> | 2013-10-18 21:14:25 +0000 |
commit | 9d5de888d6a44545ba0e468597a6c6b1423c7e78 (patch) | |
tree | 8daf27b88e63e92351b2cbea336e85c3c26807dc /gas | |
parent | bb6216d89885847997d54942e984eeb8696fed61 (diff) | |
download | gdb-9d5de888d6a44545ba0e468597a6c6b1423c7e78.zip gdb-9d5de888d6a44545ba0e468597a6c6b1423c7e78.tar.gz gdb-9d5de888d6a44545ba0e468597a6c6b1423c7e78.tar.bz2 |
2013-10-18 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
* config/tc-mips.c (fpr_read_mask): Test MSA registers.
(fpr_write_mask): Test MSA registers.
(can_swap_branch_p): Check fpr write followed by fpr read.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-mips.c | 12 |
2 files changed, 16 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 25c1503..1490eea 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2013-10-18 Chao-ying Fu <Chao-ying.Fu@imgtec.com> + + * config/tc-mips.c (fpr_read_mask): Test MSA registers. + (fpr_write_mask): Test MSA registers. + (can_swap_branch_p): Check fpr write followed by fpr read. + 2013-10-18 Nick Clifton <nickc@redhat.com> * config/tc-tic6x.c (tic6x_parse_operand): Revert previous delta. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 5741d3e..08ad7ba 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -4161,7 +4161,8 @@ fpr_read_mask (const struct mips_cl_insn *ip) unsigned long pinfo; unsigned int mask; - mask = insn_reg_mask (ip, (1 << OP_REG_FP) | (1 << OP_REG_VEC), + mask = insn_reg_mask (ip, ((1 << OP_REG_FP) | (1 << OP_REG_VEC) + | (1 << OP_REG_MSA)), insn_read_mask (ip->insn_mo)); pinfo = ip->insn_mo->pinfo; /* Conservatively treat all operands to an FP_D instruction are doubles. @@ -4179,7 +4180,8 @@ fpr_write_mask (const struct mips_cl_insn *ip) unsigned long pinfo; unsigned int mask; - mask = insn_reg_mask (ip, (1 << OP_REG_FP) | (1 << OP_REG_VEC), + mask = insn_reg_mask (ip, ((1 << OP_REG_FP) | (1 << OP_REG_VEC) + | (1 << OP_REG_MSA)), insn_write_mask (ip->insn_mo)); pinfo = ip->insn_mo->pinfo; /* Conservatively treat all operands to an FP_D instruction are doubles. @@ -6070,6 +6072,7 @@ can_swap_branch_p (struct mips_cl_insn *ip, expressionS *address_expr, { unsigned long pinfo, pinfo2, prev_pinfo, prev_pinfo2; unsigned int gpr_read, gpr_write, prev_gpr_read, prev_gpr_write; + unsigned int fpr_read, prev_fpr_write; /* -O2 and above is required for this optimization. */ if (mips_optimize < 2) @@ -6144,6 +6147,11 @@ can_swap_branch_p (struct mips_cl_insn *ip, expressionS *address_expr, if (gpr_read & prev_gpr_write) return FALSE; + fpr_read = fpr_read_mask (ip); + prev_fpr_write = fpr_write_mask (&history[0]); + if (fpr_read & prev_fpr_write) + return FALSE; + /* If the branch writes a register that the previous instruction sets, we can not swap. */ gpr_write = gpr_write_mask (ip); |