1 /* Test v2sf calculations. The nmadd and nmsub patterns need
3 /* { dg-do compile } */
4 /* { dg-mips-options "-mips32r2 -O2 -mpaired-single -ffinite-math-only" } */
5 /* { dg-final { scan-assembler "cvt.ps.s" } } */
6 /* { dg-final { scan-assembler "mov.ps" } } */
7 /* { dg-final { scan-assembler "ldc1" } } */
8 /* { dg-final { scan-assembler "sdc1" } } */
9 /* { dg-final { scan-assembler "add.ps" } } */
10 /* { dg-final { scan-assembler "sub.ps" } } */
11 /* { dg-final { scan-assembler "neg.ps" } } */
12 /* { dg-final { scan-assembler "mul.ps" } } */
13 /* { dg-final { scan-assembler "madd.ps" } } */
14 /* { dg-final { scan-assembler "msub.ps" } } */
15 /* { dg-final { scan-assembler "nmadd.ps" } } */
16 /* { dg-final { scan-assembler "nmsub.ps" } } */
17 /* { dg-final { scan-assembler "movn.ps" } } */
18 /* { dg-final { scan-assembler "movz.ps" } } */
20 typedef float v2sf
__attribute__ ((vector_size(8)));
25 /* Init from floats */
26 NOMIPS16 v2sf
init (float a
, float b
)
31 /* Move between registers */
32 NOMIPS16 v2sf
move (v2sf a
)
37 /* Load from memory */
44 NOMIPS16
void store (v2sf a
)
50 NOMIPS16 v2sf
add (v2sf a
, v2sf b
)
56 NOMIPS16 v2sf
sub (v2sf a
, v2sf b
)
62 NOMIPS16 v2sf
neg (v2sf a
)
68 NOMIPS16 v2sf
mul (v2sf a
, v2sf b
)
73 /* Multiply and add */
74 NOMIPS16 v2sf
madd (v2sf a
, v2sf b
, v2sf c
)
79 /* Multiply and subtract */
80 NOMIPS16 v2sf
msub (v2sf a
, v2sf b
, v2sf c
)
85 /* Negate Multiply and add */
86 NOMIPS16 v2sf
nmadd (v2sf a
, v2sf b
, v2sf c
)
91 /* Negate Multiply and subtract */
92 NOMIPS16 v2sf
nmsub (v2sf a
, v2sf b
, v2sf c
)
97 /* Conditional Move */
98 NOMIPS16 v2sf
cond_move1 (v2sf a
, v2sf b
, int i
)
105 /* Conditional Move */
106 NOMIPS16 v2sf
cond_move2 (v2sf a
, v2sf b
, int i
)