Commit 60986d64 by H.J. Lu Committed by H.J. Lu

ia64.c (ia64_expand_compare_and_swap): Add rmode for return mode.

2003-04-25  H.J. Lu <hjl@gnu.org>

	* config/ia64/ia64.c (ia64_expand_compare_and_swap): Add rmode
	for return mode.
	(ia64_expand_builtin): Set rmode to SImode for
	IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI,
	IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI and
	IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI. Set remode to DImode
	for IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI.

From-SVN: r66077
parent d45148c1
2003-04-25 H.J. Lu <hjl@gnu.org>
* config/ia64/ia64.c (ia64_expand_compare_and_swap): Add rmode
for return mode.
(ia64_expand_builtin): Set rmode to SImode for
IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI,
IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI and
IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI. Set remode to DImode
for IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI.
2003-04-25 Phil Edwards <pme@gcc.gnu.org> 2003-04-25 Phil Edwards <pme@gcc.gnu.org>
* configure.in (make_compare_target): Test for GNU cmp and set this * configure.in (make_compare_target): Test for GNU cmp and set this
......
...@@ -197,8 +197,9 @@ static rtx ia64_expand_fetch_and_op PARAMS ((optab, enum machine_mode, ...@@ -197,8 +197,9 @@ static rtx ia64_expand_fetch_and_op PARAMS ((optab, enum machine_mode,
tree, rtx)); tree, rtx));
static rtx ia64_expand_op_and_fetch PARAMS ((optab, enum machine_mode, static rtx ia64_expand_op_and_fetch PARAMS ((optab, enum machine_mode,
tree, rtx)); tree, rtx));
static rtx ia64_expand_compare_and_swap PARAMS ((enum machine_mode, int, static rtx ia64_expand_compare_and_swap PARAMS ((enum machine_mode,
tree, rtx)); enum machine_mode,
int, tree, rtx));
static rtx ia64_expand_lock_test_and_set PARAMS ((enum machine_mode, static rtx ia64_expand_lock_test_and_set PARAMS ((enum machine_mode,
tree, rtx)); tree, rtx));
static rtx ia64_expand_lock_release PARAMS ((enum machine_mode, tree, rtx)); static rtx ia64_expand_lock_release PARAMS ((enum machine_mode, tree, rtx));
...@@ -8026,7 +8027,8 @@ ia64_expand_op_and_fetch (binoptab, mode, arglist, target) ...@@ -8026,7 +8027,8 @@ ia64_expand_op_and_fetch (binoptab, mode, arglist, target)
*/ */
static rtx static rtx
ia64_expand_compare_and_swap (mode, boolp, arglist, target) ia64_expand_compare_and_swap (rmode, mode, boolp, arglist, target)
enum machine_mode rmode;
enum machine_mode mode; enum machine_mode mode;
int boolp; int boolp;
tree arglist; tree arglist;
...@@ -8074,7 +8076,7 @@ ia64_expand_compare_and_swap (mode, boolp, arglist, target) ...@@ -8074,7 +8076,7 @@ ia64_expand_compare_and_swap (mode, boolp, arglist, target)
if (boolp) if (boolp)
{ {
if (! target) if (! target)
target = gen_reg_rtx (mode); target = gen_reg_rtx (rmode);
return emit_store_flag_force (target, EQ, tmp, old, mode, 1, 1); return emit_store_flag_force (target, EQ, tmp, old, mode, 1, 1);
} }
else else
...@@ -8149,11 +8151,16 @@ ia64_expand_builtin (exp, target, subtarget, mode, ignore) ...@@ -8149,11 +8151,16 @@ ia64_expand_builtin (exp, target, subtarget, mode, ignore)
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
unsigned int fcode = DECL_FUNCTION_CODE (fndecl); unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
tree arglist = TREE_OPERAND (exp, 1); tree arglist = TREE_OPERAND (exp, 1);
enum machine_mode rmode;
switch (fcode) switch (fcode)
{ {
case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI: case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI:
case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI: case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI:
mode = SImode;
rmode = SImode;
break;
case IA64_BUILTIN_LOCK_TEST_AND_SET_SI: case IA64_BUILTIN_LOCK_TEST_AND_SET_SI:
case IA64_BUILTIN_LOCK_RELEASE_SI: case IA64_BUILTIN_LOCK_RELEASE_SI:
case IA64_BUILTIN_FETCH_AND_ADD_SI: case IA64_BUILTIN_FETCH_AND_ADD_SI:
...@@ -8172,7 +8179,15 @@ ia64_expand_builtin (exp, target, subtarget, mode, ignore) ...@@ -8172,7 +8179,15 @@ ia64_expand_builtin (exp, target, subtarget, mode, ignore)
break; break;
case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI: case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI:
mode = DImode;
rmode = SImode;
break;
case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI: case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI:
mode = DImode;
rmode = DImode;
break;
case IA64_BUILTIN_LOCK_TEST_AND_SET_DI: case IA64_BUILTIN_LOCK_TEST_AND_SET_DI:
case IA64_BUILTIN_LOCK_RELEASE_DI: case IA64_BUILTIN_LOCK_RELEASE_DI:
case IA64_BUILTIN_FETCH_AND_ADD_DI: case IA64_BUILTIN_FETCH_AND_ADD_DI:
...@@ -8198,11 +8213,13 @@ ia64_expand_builtin (exp, target, subtarget, mode, ignore) ...@@ -8198,11 +8213,13 @@ ia64_expand_builtin (exp, target, subtarget, mode, ignore)
{ {
case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI: case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI:
case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI: case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI:
return ia64_expand_compare_and_swap (mode, 1, arglist, target); return ia64_expand_compare_and_swap (rmode, mode, 1, arglist,
target);
case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI: case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI:
case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI: case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI:
return ia64_expand_compare_and_swap (mode, 0, arglist, target); return ia64_expand_compare_and_swap (rmode, mode, 0, arglist,
target);
case IA64_BUILTIN_SYNCHRONIZE: case IA64_BUILTIN_SYNCHRONIZE:
emit_insn (gen_mf ()); emit_insn (gen_mf ());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment