+2007-09-26 David Daney <ddaney@avtrex.com>
+
+ PR target/33479
+ * config/mips/mips.md (sync_compare_and_swap<mode>, sync_old_add<mode>,
+ sync_new_add<mode>, sync_old_<optab><mode>, sync_new_<optab><mode>,
+ sync_old_nand<mode>, sync_new_nand<mode>,
+ sync_lock_test_and_set<mode>): Fix '&' constraint modifiers.
+ Update length attributes.
+ (sync_add<mode>, sync_sub<mode>, sync_old_sub<mode>,
+ sync_new_sub<mode>, sync_<optab><mode>, sync_nand<mode>): Update
+ length attributes.
+ * config/mips/mips.h (MIPS_COMPARE_AND_SWAP, MIPS_SYNC_OP,
+ MIPS_SYNC_OLD_OP, MIPS_SYNC_NEW_OP, MIPS_SYNC_NAND,
+ MIPS_SYNC_OLD_NAND, MIPS_SYNC_NEW_NAND, MIPS_SYNC_EXCHANGE): Add
+ post-loop sync.
+
2007-09-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/33563
"1:\tll" SUFFIX "\t%0,%1\n" \
"\tbne\t%0,%2,2f\n" \
"\t" OP "\t%@,%3\n" \
- "\tsc" SUFFIX "\t%@,%1" \
- "%-\n" \
+ "\tsc" SUFFIX "\t%@,%1\n" \
"\tbeq\t%@,%.,1b\n" \
"\tnop\n" \
- "2:%]%>%)"
+ "2:\tsync%-%]%>%)"
/* Return an asm string that atomically:
"%(%<%[%|sync\n" \
"1:\tll" SUFFIX "\t%@,%0\n" \
"\t" INSN "\t%@,%@,%1\n" \
- "\tsc" SUFFIX "\t%@,%0" \
- "%-\n" \
+ "\tsc" SUFFIX "\t%@,%0\n" \
"\tbeq\t%@,%.,1b\n" \
- "\tnop%]%>%)"
+ "\tnop\n" \
+ "\tsync%-%]%>%)"
/* Return an asm string that atomically:
"%(%<%[%|sync\n" \
"1:\tll" SUFFIX "\t%0,%1\n" \
"\t" INSN "\t%@,%0,%2\n" \
- "\tsc" SUFFIX "\t%@,%1" \
- "%-\n" \
+ "\tsc" SUFFIX "\t%@,%1\n" \
"\tbeq\t%@,%.,1b\n" \
- "\tnop%]%>%)"
+ "\tnop\n" \
+ "\tsync%-%]%>%)"
/* Return an asm string that atomically:
"%(%<%[%|sync\n" \
"1:\tll" SUFFIX "\t%0,%1\n" \
"\t" INSN "\t%@,%0,%2\n" \
- "\tsc" SUFFIX "\t%@,%1" \
- "%-\n" \
+ "\tsc" SUFFIX "\t%@,%1\n" \
"\tbeq\t%@,%.,1b\n" \
- "\t" INSN "\t%0,%0,%2%]%>%)"
+ "\t" INSN "\t%0,%0,%2\n" \
+ "\tsync%-%]%>%)"
/* Return an asm string that atomically:
"1:\tll" SUFFIX "\t%@,%0\n" \
"\tnor\t%@,%@,%.\n" \
"\t" INSN "\t%@,%@,%1\n" \
- "\tsc" SUFFIX "\t%@,%0" \
- "%-\n" \
+ "\tsc" SUFFIX "\t%@,%0\n" \
"\tbeq\t%@,%.,1b\n" \
- "\tnop%]%>%)"
+ "\tnop\n" \
+ "\tsync%-%]%>%)"
/* Return an asm string that atomically:
"1:\tll" SUFFIX "\t%0,%1\n" \
"\tnor\t%@,%0,%.\n" \
"\t" INSN "\t%@,%@,%2\n" \
- "\tsc" SUFFIX "\t%@,%1" \
- "%-\n" \
+ "\tsc" SUFFIX "\t%@,%1\n" \
"\tbeq\t%@,%.,1b\n" \
- "\tnop%]%>%)"
+ "\tnop\n" \
+ "\tsync%-%]%>%)"
/* Return an asm string that atomically:
"1:\tll" SUFFIX "\t%0,%1\n" \
"\tnor\t%0,%0,%.\n" \
"\t" INSN "\t%@,%0,%2\n" \
- "\tsc" SUFFIX "\t%@,%1" \
- "%-\n" \
+ "\tsc" SUFFIX "\t%@,%1\n" \
"\tbeq\t%@,%.,1b\n" \
- "\t" INSN "\t%0,%0,%2%]%>%)"
+ "\t" INSN "\t%0,%0,%2\n" \
+ "\tsync%-%]%>%)"
/* Return an asm string that atomically:
"%|sync%-")
(define_insn "sync_compare_and_swap<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,d")
+ [(set (match_operand:GPR 0 "register_operand" "=&d,&d")
(match_operand:GPR 1 "memory_operand" "+R,R"))
(set (match_dup 1)
(unspec_volatile:GPR [(match_operand:GPR 2 "register_operand" "d,d")
else
return MIPS_COMPARE_AND_SWAP ("<d>", "move");
}
- [(set_attr "length" "28")])
+ [(set_attr "length" "32")])
(define_insn "sync_add<mode>"
[(set (match_operand:GPR 0 "memory_operand" "+R,R")
else
return MIPS_SYNC_OP ("<d>", "<d>addu");
}
- [(set_attr "length" "24")])
+ [(set_attr "length" "28")])
(define_insn "sync_sub<mode>"
[(set (match_operand:GPR 0 "memory_operand" "+R")
UNSPEC_SYNC_OLD_OP))]
"GENERATE_LL_SC"
{
- return MIPS_SYNC_OP ("<d>", "<d>subu");
+ return MIPS_SYNC_OP ("<d>", "<d>subu");
}
- [(set_attr "length" "24")])
+ [(set_attr "length" "28")])
(define_insn "sync_old_add<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,d")
+ [(set (match_operand:GPR 0 "register_operand" "=d,&d")
(match_operand:GPR 1 "memory_operand" "+R,R"))
(set (match_dup 1)
(unspec_volatile:GPR
else
return MIPS_SYNC_OLD_OP ("<d>", "<d>addu");
}
- [(set_attr "length" "24")])
+ [(set_attr "length" "28")])
(define_insn "sync_old_sub<mode>"
[(set (match_operand:GPR 0 "register_operand" "=&d")
{
return MIPS_SYNC_OLD_OP ("<d>", "<d>subu");
}
- [(set_attr "length" "24")])
+ [(set_attr "length" "28")])
(define_insn "sync_new_add<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,d")
+ [(set (match_operand:GPR 0 "register_operand" "=d,&d")
(plus:GPR (match_operand:GPR 1 "memory_operand" "+R,R")
(match_operand:GPR 2 "arith_operand" "I,d")))
(set (match_dup 1)
else
return MIPS_SYNC_NEW_OP ("<d>", "<d>addu");
}
- [(set_attr "length" "24")])
+ [(set_attr "length" "28")])
(define_insn "sync_new_sub<mode>"
[(set (match_operand:GPR 0 "register_operand" "=&d")
{
return MIPS_SYNC_NEW_OP ("<d>", "<d>subu");
}
- [(set_attr "length" "24")])
+ [(set_attr "length" "28")])
(define_insn "sync_<optab><mode>"
[(set (match_operand:GPR 0 "memory_operand" "+R,R")
else
return MIPS_SYNC_OP ("<d>", "<insn>");
}
- [(set_attr "length" "24")])
+ [(set_attr "length" "28")])
(define_insn "sync_old_<optab><mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,d")
+ [(set (match_operand:GPR 0 "register_operand" "=d,&d")
(match_operand:GPR 1 "memory_operand" "+R,R"))
(set (match_dup 1)
(unspec_volatile:GPR
else
return MIPS_SYNC_OLD_OP ("<d>", "<insn>");
}
- [(set_attr "length" "24")])
+ [(set_attr "length" "28")])
(define_insn "sync_new_<optab><mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,d")
+ [(set (match_operand:GPR 0 "register_operand" "=d,&d")
(match_operand:GPR 1 "memory_operand" "+R,R"))
(set (match_dup 1)
(unspec_volatile:GPR
else
return MIPS_SYNC_NEW_OP ("<d>", "<insn>");
}
- [(set_attr "length" "24")])
+ [(set_attr "length" "28")])
(define_insn "sync_nand<mode>"
[(set (match_operand:GPR 0 "memory_operand" "+R,R")
else
return MIPS_SYNC_NAND ("<d>", "and");
}
- [(set_attr "length" "28")])
+ [(set_attr "length" "32")])
(define_insn "sync_old_nand<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,d")
+ [(set (match_operand:GPR 0 "register_operand" "=d,&d")
(match_operand:GPR 1 "memory_operand" "+R,R"))
(set (match_dup 1)
(unspec_volatile:GPR [(match_operand:GPR 2 "uns_arith_operand" "K,d")]
else
return MIPS_SYNC_OLD_NAND ("<d>", "and");
}
- [(set_attr "length" "28")])
+ [(set_attr "length" "32")])
(define_insn "sync_new_nand<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,d")
+ [(set (match_operand:GPR 0 "register_operand" "=d,&d")
(match_operand:GPR 1 "memory_operand" "+R,R"))
(set (match_dup 1)
(unspec_volatile:GPR [(match_operand:GPR 2 "uns_arith_operand" "K,d")]
else
return MIPS_SYNC_NEW_NAND ("<d>", "and");
}
- [(set_attr "length" "28")])
+ [(set_attr "length" "32")])
(define_insn "sync_lock_test_and_set<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,d")
+ [(set (match_operand:GPR 0 "register_operand" "=d,&d")
(match_operand:GPR 1 "memory_operand" "+R,R"))
(set (match_dup 1)
(unspec_volatile:GPR [(match_operand:GPR 2 "arith_operand" "I,d")]