1 /* { dg-options "-mdspr2 -mgp32 -mtune=4kp" } */
2 /* References to RESULT within the loop need to have a higher frequency than
3 references to RESULT outside the loop, otherwise there is no reason
4 to prefer multiply/accumulator registers over GPRs. */
5 /* { dg-skip-if "requires register frequencies" { *-*-* } { "-O0" "-Os" } { "" } } */
7 /* Check that the zero-initialization of the accumulator feeding into
8 the madd is done by means of an mthi & mtlo pair instead of a
9 "mult $0,$0" instruction. */
11 NOMIPS16
long long f (int n
, int *v
, int m
)
16 for (i
= 0; i
< n
; i
++)
17 result
= __builtin_mips_madd (result
, v
[i
], m
);
21 /* { dg-final { scan-assembler-not "mult\t\[^\n\]*\\\$0" } } */
22 /* { dg-final { scan-assembler "\tmthi\t" } } */
23 /* { dg-final { scan-assembler "\tmtlo\t" } } */