| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=rv32i -mabi=ilp32 -O" { target { rv32 } } } */ |
| 3 |
/* { dg-options "-march=rv64i -mabi=lp64 -O" { target { rv64 } } } */ |
| 4 |
|
| 5 |
/* 1) bf -> sf (call __extendbfsf2) */ |
| 6 |
/* 2) sf1 [<|<=|>|>=|==] sf2 (call __[lt|le|gt|ge|eq]sf2) */ |
| 7 |
extern __bf16 bf; |
| 8 |
extern __bf16 bf1; |
| 9 |
extern __bf16 bf2; |
| 10 |
|
| 11 |
void bf_lt_bf () { bf = (bf1 < bf2) ? bf1 : bf2; } |
| 12 |
|
| 13 |
void bf_le_bf () { bf = (bf1 <= bf2) ? bf1 : bf2; } |
| 14 |
|
| 15 |
void bf_gt_bf () { bf = (bf1 > bf2) ? bf1 : bf2; } |
| 16 |
|
| 17 |
void bf_ge_bf () { bf = (bf1 >= bf2) ? bf1 : bf2; } |
| 18 |
|
| 19 |
void bf_eq_bf () { bf = (bf1 == bf2) ? bf1 : bf2; } |
| 20 |
|
| 21 |
void bf_lt_const () { bf = (bf1 < 3.14f) ? bf1 : bf2; } |
| 22 |
|
| 23 |
void bf_le_const () { bf = (bf1 <= 3.14f) ? bf1 : bf2; } |
| 24 |
|
| 25 |
void const_gt_bf () { bf = (3.14f > bf2) ? bf1 : bf2; } |
| 26 |
|
| 27 |
void const_ge_bf () { bf = (3.14f >= bf2) ? bf1 : bf2; } |
| 28 |
|
| 29 |
void bf_eq_const () { bf = (bf1 == 3.14f) ? bf1 : bf2; } |
| 30 |
|
| 31 |
/* { dg-final { scan-assembler-times "call\t__extendbfsf2" 15 } } */ |
| 32 |
/* { dg-final { scan-assembler-not "call\t__ltbf2" } } */ |
| 33 |
/* { dg-final { scan-assembler-not "call\t__lebf2" } } */ |
| 34 |
/* { dg-final { scan-assembler-not "call\t__gtbf2" } } */ |
| 35 |
/* { dg-final { scan-assembler-not "call\t__gebf2" } } */ |
| 36 |
/* { dg-final { scan-assembler-not "call\t__eqbf2" } } */ |