1 /* Test the IACC multiply/accumulate instructions. Also test the IACC
2 read/write functions. */
3 /* { dg-options "-mcpu=fr405" } */
5 extern void abort (void);
6 extern void exit (int);
10 long long res
, res1
, res2
, res3
;
12 __SMU (0x12345678, 0x40004000);
13 __SMASS (0x12000000, 0x11223344);
14 __SMSSS (0x01020304, 0x54321000);
16 res
= __IACCreadll (0);
17 res1
= 0x12345678LL
* 0x40004000LL
;
18 res2
= 0x12000000LL
* 0x11223344LL
;
19 res3
= 0x01020304LL
* 0x54321000LL
;
20 if (res
!= res1
+ res2
- res3
)
23 __IACCsetll (0, 0x7ffffffffffffff0LL
);
24 __SMASS (0x100, 0x100);
25 if (__IACCreadll (0) != 0x7fffffffffffffffLL
)
28 __IACCsetl (0, -0x7ffffffe);
30 __SMSSS (0x10001, 0x10000);
31 if (__IACCreadl (0) != -0x7fffffff - 1 || __IACCreadl (1) != -0x10000)
34 __SMSSS (0x10001, 0x10000);
35 if (__IACCreadl (0) != -0x7fffffff - 1 || __IACCreadl (1) != 0)