and OP is the instruction that should be used to load %3 into a
register. */
#define MIPS_COMPARE_AND_SWAP(SUFFIX, OP) \
- "%(%<%[%|sync\n" \
- "1:\tll" SUFFIX "\t%0,%1\n" \
+ "%(%<%[%|1:\tll" SUFFIX "\t%0,%1\n" \
"\tbne\t%0,%z2,2f\n" \
"\t" OP "\t%@,%3\n" \
"\tsc" SUFFIX "\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b\n" \
- "\tnop\n" \
- "\tsync%-%]%>%)\n" \
+ "\tnop%-%]%>%)\n" \
"2:\n"
/* Return an asm string that atomically:
OPS are the instructions needed to OR %5 with %@. */
#define MIPS_COMPARE_AND_SWAP_12(OPS) \
- "%(%<%[%|sync\n" \
- "1:\tll\t%0,%1\n" \
+ "%(%<%[%|1:\tll\t%0,%1\n" \
"\tand\t%@,%0,%2\n" \
"\tbne\t%@,%z4,2f\n" \
"\tand\t%@,%0,%3\n" \
OPS \
"\tsc\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b\n" \
- "\tnop\n" \
- "\tsync%-%]%>%)\n" \
+ "\tnop%-%]%>%)\n" \
"2:\n"
#define MIPS_COMPARE_AND_SWAP_12_ZERO_OP ""
SUFFIX is the suffix that should be added to "ll" and "sc"
instructions. */
#define MIPS_SYNC_OP(SUFFIX, INSN) \
- "%(%<%[%|sync\n" \
- "1:\tll" SUFFIX "\t%@,%0\n" \
+ "%(%<%[%|1:\tll" SUFFIX "\t%@,%0\n" \
"\t" INSN "\t%@,%@,%1\n" \
"\tsc" SUFFIX "\t%@,%0\n" \
"\tbeq%?\t%@,%.,1b\n" \
- "\tnop\n" \
- "\tsync%-%]%>%)"
+ "\tnop%-%]%>%)"
/* Return an asm string that atomically:
INSN is already correctly masked -- it instead performs a bitwise
not. */
#define MIPS_SYNC_OP_12(INSN, AND_OP) \
- "%(%<%[%|sync\n" \
- "1:\tll\t%4,%0\n" \
+ "%(%<%[%|1:\tll\t%4,%0\n" \
"\tand\t%@,%4,%2\n" \
"\t" INSN "\t%4,%4,%z3\n" \
AND_OP \
"\tor\t%@,%@,%4\n" \
"\tsc\t%@,%0\n" \
"\tbeq%?\t%@,%.,1b\n" \
- "\tnop\n" \
- "\tsync%-%]%>%)"
+ "\tnop%-%]%>%)"
#define MIPS_SYNC_OP_12_AND "\tand\t%4,%4,%1\n"
#define MIPS_SYNC_OP_12_XOR "\txor\t%4,%4,%1\n"
INSN is already correctly masked -- it instead performs a bitwise
not. */
#define MIPS_SYNC_OLD_OP_12(INSN, AND_OP) \
- "%(%<%[%|sync\n" \
- "1:\tll\t%0,%1\n" \
+ "%(%<%[%|1:\tll\t%0,%1\n" \
"\tand\t%@,%0,%3\n" \
"\t" INSN "\t%5,%0,%z4\n" \
AND_OP \
"\tor\t%@,%@,%5\n" \
"\tsc\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b\n" \
- "\tnop\n" \
- "\tsync%-%]%>%)"
+ "\tnop%-%]%>%)"
#define MIPS_SYNC_OLD_OP_12_AND "\tand\t%5,%5,%2\n"
#define MIPS_SYNC_OLD_OP_12_XOR "\txor\t%5,%5,%2\n"
INSN is already correctly masked -- it instead performs a bitwise
not. */
#define MIPS_SYNC_NEW_OP_12(INSN, AND_OP) \
- "%(%<%[%|sync\n" \
- "1:\tll\t%0,%1\n" \
+ "%(%<%[%|1:\tll\t%0,%1\n" \
"\tand\t%@,%0,%3\n" \
"\t" INSN "\t%0,%0,%z4\n" \
AND_OP \
"\tor\t%@,%@,%0\n" \
"\tsc\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b\n" \
- "\tnop\n" \
- "\tsync%-%]%>%)"
+ "\tnop%-%]%>%)"
#define MIPS_SYNC_NEW_OP_12_AND "\tand\t%0,%0,%2\n"
#define MIPS_SYNC_NEW_OP_12_XOR "\txor\t%0,%0,%2\n"
SUFFIX is the suffix that should be added to "ll" and "sc"
instructions. */
#define MIPS_SYNC_OLD_OP(SUFFIX, INSN) \
- "%(%<%[%|sync\n" \
- "1:\tll" SUFFIX "\t%0,%1\n" \
+ "%(%<%[%|1:\tll" SUFFIX "\t%0,%1\n" \
"\t" INSN "\t%@,%0,%2\n" \
"\tsc" SUFFIX "\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b\n" \
- "\tnop\n" \
- "\tsync%-%]%>%)"
+ "\tnop%-%]%>%)"
/* Return an asm string that atomically:
SUFFIX is the suffix that should be added to "ll" and "sc"
instructions. */
#define MIPS_SYNC_NEW_OP(SUFFIX, INSN) \
- "%(%<%[%|sync\n" \
- "1:\tll" SUFFIX "\t%0,%1\n" \
+ "%(%<%[%|1:\tll" SUFFIX "\t%0,%1\n" \
"\t" INSN "\t%@,%0,%2\n" \
"\tsc" SUFFIX "\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b%~\n" \
- "\t" INSN "\t%0,%0,%2\n" \
- "\tsync%-%]%>%)"
+ "\t" INSN "\t%0,%0,%2%-%]%>%)"
/* Return an asm string that atomically:
instructions. INSN is the and instruction needed to and a register
with %2. */
#define MIPS_SYNC_NAND(SUFFIX, INSN) \
- "%(%<%[%|sync\n" \
- "1:\tll" SUFFIX "\t%@,%0\n" \
+ "%(%<%[%|1:\tll" SUFFIX "\t%@,%0\n" \
"\t" INSN "\t%@,%@,%1\n" \
"\tnor\t%@,%@,%.\n" \
"\tsc" SUFFIX "\t%@,%0\n" \
"\tbeq%?\t%@,%.,1b\n" \
- "\tnop\n" \
- "\tsync%-%]%>%)"
+ "\tnop%-%]%>%)"
/* Return an asm string that atomically:
instructions. INSN is the and instruction needed to and a register
with %2. */
#define MIPS_SYNC_OLD_NAND(SUFFIX, INSN) \
- "%(%<%[%|sync\n" \
- "1:\tll" SUFFIX "\t%0,%1\n" \
+ "%(%<%[%|1:\tll" SUFFIX "\t%0,%1\n" \
"\t" INSN "\t%@,%0,%2\n" \
"\tnor\t%@,%@,%.\n" \
"\tsc" SUFFIX "\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b\n" \
- "\tnop\n" \
- "\tsync%-%]%>%)"
+ "\tnop%-%]%>%)"
/* Return an asm string that atomically:
instructions. INSN is the and instruction needed to and a register
with %2. */
#define MIPS_SYNC_NEW_NAND(SUFFIX, INSN) \
- "%(%<%[%|sync\n" \
- "1:\tll" SUFFIX "\t%0,%1\n" \
+ "%(%<%[%|1:\tll" SUFFIX "\t%0,%1\n" \
"\t" INSN "\t%0,%0,%2\n" \
"\tnor\t%@,%0,%.\n" \
"\tsc" SUFFIX "\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b%~\n" \
- "\tnor\t%0,%0,%.\n" \
- "\tsync%-%]%>%)"
+ "\tnor\t%0,%0,%.%-%]%>%)"
/* Return an asm string that atomically:
"\t" OP "\t%@,%2\n" \
"\tsc" SUFFIX "\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b\n" \
- "\tnop\n" \
- "\tsync%-%]%>%)"
+ "\tnop%-%]%>%)"
/* Return an asm string that atomically:
OPS \
"\tsc\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b\n" \
- "\tnop\n" \
- "\tsync%-%]%>%)"
+ "\tnop%-%]%>%)"
#define MIPS_SYNC_EXCHANGE_12_ZERO_OP ""
#define MIPS_SYNC_EXCHANGE_12_NONZERO_OP "\tor\t%@,%@,%4\n"
UNSPEC_COMPARE_AND_SWAP))]
"GENERATE_LL_SC"
{
+ const char *loop;
if (which_alternative == 0)
- return mips_output_sync_loop (MIPS_COMPARE_AND_SWAP ("<d>", "li"));
+ loop = MIPS_COMPARE_AND_SWAP ("<d>", "li");
else
- return mips_output_sync_loop (MIPS_COMPARE_AND_SWAP ("<d>", "move"));
+ loop = MIPS_COMPARE_AND_SWAP ("<d>", "move");
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "32")])
UNSPEC_COMPARE_AND_SWAP_12))]
"GENERATE_LL_SC"
{
+ const char *loop;
if (which_alternative == 0)
- return (mips_output_sync_loop
- (MIPS_COMPARE_AND_SWAP_12 (MIPS_COMPARE_AND_SWAP_12_NONZERO_OP)));
+ loop = MIPS_COMPARE_AND_SWAP_12 (MIPS_COMPARE_AND_SWAP_12_NONZERO_OP);
else
- return (mips_output_sync_loop
- (MIPS_COMPARE_AND_SWAP_12 (MIPS_COMPARE_AND_SWAP_12_ZERO_OP)));
+ loop = MIPS_COMPARE_AND_SWAP_12 (MIPS_COMPARE_AND_SWAP_12_ZERO_OP);
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "40,36")])
UNSPEC_SYNC_OLD_OP))]
"GENERATE_LL_SC"
{
+ const char *loop;
if (which_alternative == 0)
- return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<d>addiu"));
+ loop = MIPS_SYNC_OP ("<d>", "<d>addiu");
else
- return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<d>addu"));
+ loop = MIPS_SYNC_OP ("<d>", "<d>addu");
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "28")])
(clobber (match_scratch:SI 4 "=&d"))]
"GENERATE_LL_SC"
{
- return (mips_output_sync_loop
- (MIPS_SYNC_OP_12 ("<insn>", MIPS_SYNC_OP_12_AND)));
+ const char *loop = MIPS_SYNC_OP_12 ("<insn>", MIPS_SYNC_OP_12_AND);
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "40")])
(clobber (match_scratch:SI 5 "=&d"))]
"GENERATE_LL_SC"
{
- return (mips_output_sync_loop
- (MIPS_SYNC_OLD_OP_12 ("<insn>", MIPS_SYNC_OLD_OP_12_AND)));
+ const char *loop = MIPS_SYNC_OLD_OP_12 ("<insn>", MIPS_SYNC_OLD_OP_12_AND);
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "40")])
(match_dup 4)] UNSPEC_SYNC_NEW_OP_12))]
"GENERATE_LL_SC"
{
- return (mips_output_sync_loop
- (MIPS_SYNC_NEW_OP_12 ("<insn>", MIPS_SYNC_NEW_OP_12_AND)));
+ const char *loop = MIPS_SYNC_NEW_OP_12 ("<insn>", MIPS_SYNC_NEW_OP_12_AND);
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "40")])
(clobber (match_scratch:SI 4 "=&d"))]
"GENERATE_LL_SC"
{
- return (mips_output_sync_loop
- (MIPS_SYNC_OP_12 ("and", MIPS_SYNC_OP_12_XOR)));
+ const char *loop = MIPS_SYNC_OP_12 ("and", MIPS_SYNC_OP_12_XOR);
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "40")])
(clobber (match_scratch:SI 5 "=&d"))]
"GENERATE_LL_SC"
{
- return (mips_output_sync_loop
- (MIPS_SYNC_OLD_OP_12 ("and", MIPS_SYNC_OLD_OP_12_XOR)));
+ const char *loop = MIPS_SYNC_OLD_OP_12 ("and", MIPS_SYNC_OLD_OP_12_XOR);
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "40")])
(match_dup 4)] UNSPEC_SYNC_NEW_OP_12))]
"GENERATE_LL_SC"
{
- return (mips_output_sync_loop
- (MIPS_SYNC_NEW_OP_12 ("and", MIPS_SYNC_NEW_OP_12_XOR)));
+ const char *loop = MIPS_SYNC_NEW_OP_12 ("and", MIPS_SYNC_NEW_OP_12_XOR);
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "40")])
UNSPEC_SYNC_OLD_OP))]
"GENERATE_LL_SC"
{
- return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<d>subu"));
+ const char *loop = MIPS_SYNC_OP ("<d>", "<d>subu");
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "28")])
UNSPEC_SYNC_OLD_OP))]
"GENERATE_LL_SC"
{
+ const char *loop;
if (which_alternative == 0)
- return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<d>addiu"));
+ loop = MIPS_SYNC_OLD_OP ("<d>", "<d>addiu");
else
- return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<d>addu"));
+ loop = MIPS_SYNC_OLD_OP ("<d>", "<d>addu");
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "28")])
UNSPEC_SYNC_OLD_OP))]
"GENERATE_LL_SC"
{
- return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<d>subu"));
+ const char *loop = MIPS_SYNC_OLD_OP ("<d>", "<d>subu");
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "28")])
UNSPEC_SYNC_NEW_OP))]
"GENERATE_LL_SC"
{
+ const char *loop;
if (which_alternative == 0)
- return mips_output_sync_loop (MIPS_SYNC_NEW_OP ("<d>", "<d>addiu"));
+ loop = MIPS_SYNC_NEW_OP ("<d>", "<d>addiu");
else
- return mips_output_sync_loop (MIPS_SYNC_NEW_OP ("<d>", "<d>addu"));
+ loop = MIPS_SYNC_NEW_OP ("<d>", "<d>addu");
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "28")])
UNSPEC_SYNC_NEW_OP))]
"GENERATE_LL_SC"
{
- return mips_output_sync_loop (MIPS_SYNC_NEW_OP ("<d>", "<d>subu"));
+ const char *loop = MIPS_SYNC_NEW_OP ("<d>", "<d>subu");
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "28")])
UNSPEC_SYNC_OLD_OP))]
"GENERATE_LL_SC"
{
+ const char *loop;
if (which_alternative == 0)
- return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<immediate_insn>"));
+ loop = MIPS_SYNC_OP ("<d>", "<immediate_insn>");
else
- return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<insn>"));
+ loop = MIPS_SYNC_OP ("<d>", "<insn>");
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "28")])
UNSPEC_SYNC_OLD_OP))]
"GENERATE_LL_SC"
{
+ const char *loop;
if (which_alternative == 0)
- return (mips_output_sync_loop
- (MIPS_SYNC_OLD_OP ("<d>", "<immediate_insn>")));
+ loop = MIPS_SYNC_OLD_OP ("<d>", "<immediate_insn>");
else
- return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<insn>"));
+ loop = MIPS_SYNC_OLD_OP ("<d>", "<insn>");
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "28")])
UNSPEC_SYNC_NEW_OP))]
"GENERATE_LL_SC"
{
+ const char *loop;
if (which_alternative == 0)
- return (mips_output_sync_loop
- (MIPS_SYNC_NEW_OP ("<d>", "<immediate_insn>")));
+ loop = MIPS_SYNC_NEW_OP ("<d>", "<immediate_insn>");
else
- return mips_output_sync_loop (MIPS_SYNC_NEW_OP ("<d>", "<insn>"));
+ loop = MIPS_SYNC_NEW_OP ("<d>", "<insn>");
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "28")])
UNSPEC_SYNC_OLD_OP))]
"GENERATE_LL_SC"
{
+ const char *loop;
if (which_alternative == 0)
- return mips_output_sync_loop (MIPS_SYNC_NAND ("<d>", "andi"));
+ loop = MIPS_SYNC_NAND ("<d>", "andi");
else
- return mips_output_sync_loop (MIPS_SYNC_NAND ("<d>", "and"));
+ loop = MIPS_SYNC_NAND ("<d>", "and");
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "32")])
UNSPEC_SYNC_OLD_OP))]
"GENERATE_LL_SC"
{
+ const char *loop;
if (which_alternative == 0)
- return mips_output_sync_loop (MIPS_SYNC_OLD_NAND ("<d>", "andi"));
+ loop = MIPS_SYNC_OLD_NAND ("<d>", "andi");
else
- return mips_output_sync_loop (MIPS_SYNC_OLD_NAND ("<d>", "and"));
+ loop = MIPS_SYNC_OLD_NAND ("<d>", "and");
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "32")])
UNSPEC_SYNC_NEW_OP))]
"GENERATE_LL_SC"
{
+ const char *loop;
if (which_alternative == 0)
- return mips_output_sync_loop (MIPS_SYNC_NEW_NAND ("<d>", "andi"));
+ loop = MIPS_SYNC_NEW_NAND ("<d>", "andi");
else
- return mips_output_sync_loop (MIPS_SYNC_NEW_NAND ("<d>", "and"));
+ loop = MIPS_SYNC_NEW_NAND ("<d>", "and");
+ return mips_output_sync_loop (true, loop, operands);
}
[(set_attr "length" "32")])
UNSPEC_SYNC_EXCHANGE))]
"GENERATE_LL_SC"
{
+ const char *loop;
if (which_alternative == 0)
- return mips_output_sync_loop (MIPS_SYNC_EXCHANGE ("<d>", "li"));
+ loop = MIPS_SYNC_EXCHANGE ("<d>", "li");
else
- return mips_output_sync_loop (MIPS_SYNC_EXCHANGE ("<d>", "move"));
+ loop = MIPS_SYNC_EXCHANGE ("<d>", "move");
+ return mips_output_sync_loop (false, loop, operands);
}
[(set_attr "length" "24")])
UNSPEC_SYNC_EXCHANGE_12))]
"GENERATE_LL_SC"
{
+ const char *loop;
if (which_alternative == 0)
- return (mips_output_sync_loop
- (MIPS_SYNC_EXCHANGE_12 (MIPS_SYNC_EXCHANGE_12_NONZERO_OP)));
+ loop = MIPS_SYNC_EXCHANGE_12 (MIPS_SYNC_EXCHANGE_12_NONZERO_OP);
else
- return (mips_output_sync_loop
- (MIPS_SYNC_EXCHANGE_12 (MIPS_SYNC_EXCHANGE_12_ZERO_OP)));
+ loop = MIPS_SYNC_EXCHANGE_12 (MIPS_SYNC_EXCHANGE_12_ZERO_OP);
+ return mips_output_sync_loop (false, loop, operands);
}
[(set_attr "length" "28,24")])