| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target rv64 } */ |
| 3 |
/* { dg-options "-march=rv64gc_zbb_zbc_zbkb_zbkc -mabi=lp64d " } */ |
| 4 |
/* { dg-skip-if "" { *-*-* } { "-g" "-O0" "-flto"} } */ |
| 5 |
|
| 6 |
#include "riscv_bitmanip.h" |
| 7 |
|
| 8 |
uint32_t foo (uint32_t rs1) |
| 9 |
{ |
| 10 |
return __riscv_rev8_32 (rs1); |
| 11 |
} |
| 12 |
|
| 13 |
int32_t foo2(uint32_t rs1) |
| 14 |
{ |
| 15 |
return __riscv_brev8_32 (rs1); |
| 16 |
} |
| 17 |
|
| 18 |
uint32_t foo3 (uint32_t rs1) |
| 19 |
{ |
| 20 |
return __riscv_orc_b_32 (rs1); |
| 21 |
|
| 22 |
} |
| 23 |
|
| 24 |
uint32_t foo4 (uint32_t rs1) |
| 25 |
{ |
| 26 |
return __riscv_clmul_32 (rs1,rs1); |
| 27 |
} |
| 28 |
|
| 29 |
/* { dg-final { scan-assembler-times {\mrev8} 1 } } */ |
| 30 |
/* { dg-final { scan-assembler-times "brev8" 1 } } */ |
| 31 |
/* { dg-final { scan-assembler-times "clmul" 1 } } */ |
| 32 |
/* { dg-final { scan-assembler-times "orc.b" 1 } } */ |
| 33 |
/* { dg-final { scan-assembler-times "sext.w" 3 } } */ |