/* It is going to be a load/store on condition. Make it
slightly more expensive than a normal load. */
- *total = COSTS_N_INSNS (1) + 1;
+ *total = COSTS_N_INSNS (1) + 2;
rtx dst = SET_DEST (x);
rtx then = XEXP (SET_SRC (x), 1);
if (!CONSTANT_P (els))
els = simplify_gen_subreg (E_SImode, els, <MODE>mode, 0);
- rtx tmp_target = gen_reg_rtx (E_SImode);
+ rtx tmp_target = simplify_gen_subreg (E_SImode, operands[0], <MODE>mode, 0);
+
emit_insn (gen_movsicc (tmp_target, operands[1], then, els));
- emit_move_insn (operands[0], gen_lowpart (<MODE>mode, tmp_target));
DONE;
})
/* { dg-final { scan-assembler "lochinle\t%r.?,1" } } */
/* { dg-final { scan-assembler "locrnle\t.*" } } */
-#include <stdbool.h>
#include <limits.h>
#include <stdio.h>
#include <assert.h>
{
int a[] = {2, 1, -13, INT_MAX, INT_MIN, 0};
- int res = foo (a, sizeof (a));
+ int res = foo (a, sizeof (a) / sizeof (a[0]));
assert (res == (INT_MIN + 1));
}
/* { dg-final { scan-assembler "locghinle\t%r.?,1" } } */
/* { dg-final { scan-assembler "locgrnle\t.*" } } */
-#include <stdbool.h>
#include <limits.h>
#include <stdio.h>
#include <assert.h>
{
long a[] = {2, 1, -13, LONG_MAX, LONG_MIN, 0};
- long res = foo (a, sizeof (a));
+ long res = foo (a, sizeof (a) / sizeof (a[0]));
assert (res == (LONG_MIN + 1));
}