blob: 4eb826753294cc5a41f047c85e35ae5c24a00951 [file] [log] [blame]
/* { dg-do compile } */
/* { dg-require-effective-target rv64 } */
/* { dg-skip-if "" { *-*-* } { "-O0" "-Og" "-Os" "-Oz" } } */
/* { dg-options "-march=rv64gc -mtune=sifive-5-series -mbranch-cost=6 -mmovcc -fdump-rtl-ce1" } */
typedef unsigned int __attribute__ ((mode (DI))) int_t;
int_t
movdileu (int_t w, int_t x, int_t y, int_t z)
{
return w <= x ? y : z;
}
/* Expect branchless assembly like:
sgtu a1,a0,a1
neg a1,a1
and a3,a1,a3
not a1,a1
and a1,a1,a2
or a0,a3,a1
*/
/* { dg-final { scan-rtl-dump-times "Conversion succeeded on pass 1\\." 1 "ce1" } } */
/* { dg-final { scan-rtl-dump-times "if-conversion succeeded through noce_try_cmove" 1 "ce1" } } */
/* { dg-final { scan-assembler-times "\\s(?:sgtu|sltu)\\s" 1 } } */
/* { dg-final { scan-assembler-not "\\s(?:seqz|snez)\\s" } } */
/* { dg-final { scan-assembler-not "\\s(?:bgeu|bgtu|bleu|bltu)\\s" } } */