Debian Codegraph @

gcc/testsuite/gcc.target/msp430/rtx-cost-Os-f5series.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-Os -mhwmult=f5series" } */
3 /* { dg-final { check-function-bodies "**" "" } } */
4
5 /* Verify the MSP430 cost model is working as expected for the default ISA
6 (msp430x) and f5series hwmult, when compiling at -Os. */
7
8 volatile unsigned long a;
9 volatile unsigned int b;
10 volatile unsigned long c;
11 unsigned long res1;
12 unsigned long res2;
13 unsigned long res3;
14
15 /*
16 ** foo:
17 ** ...
18 ** MOV.B #16, R14
19 ** CALL.* #__mspabi_slll
20 ** ...
21 ** MOV.B #7, R14
22 ** CALL.* #__mspabi_slll
23 ** ...
24 ** MOV.B #100, R14
25 ** MOV.B #0, R15
26 ** ...
27 ** CALL.* #__mspabi_mpyl_f5hw
28 ** ...
29 */
30 void foo (void)
31 {
32 /* Use the shift library function for this. */
33 res1 = (a << 16) | b;
34 /* Likewise. */
35 res2 *= 128;
36 /* Use the hardware multiply library function for this. */
37 res3 *= 100;
38 }