1 /* Test the SCUTSS instruction. */
2 /* { dg-options "-mcpu=fr405" } */
4 extern void abort (void);
5 extern void exit (int);
14 /* Non-saturating values */
16 { +0x0000000000001234LL
, 44, +0x01234000 },
17 { ~0x0000000000001234LL
, 44, ~0x01234fff },
19 { +0x0000011223300fffLL
, 20, +0x11223301 },
20 { ~0x0000011223300fffLL
, 20, ~0x11223300 },
21 { +0x0000011223300800LL
, 20, +0x11223301 },
22 { ~0x0000011223300800LL
, 20, ~0x11223300 },
23 { +0x00000112233007ffLL
, 20, +0x11223300 },
24 { ~0x00000112233007ffLL
, 20, ~0x112232ff },
25 { +0x0000011223300000LL
, 20, +0x11223300 },
26 { ~0x0000011223300000LL
, 20, ~0x112232ff },
28 { +0x1234567fffffffffLL
, -4, +0x01234568 },
29 { ~0x1234567fffffffffLL
, -4, ~0x01234567 },
30 { +0x1234567800000000LL
, -4, +0x01234568 },
31 { ~0x1234567800000000LL
, -4, ~0x01234567 },
32 { +0x12345677ffffffffLL
, -4, +0x01234567 },
33 { ~0x12345677ffffffffLL
, -4, ~0x01234566 },
34 { +0x1234567000000000LL
, -4, +0x01234567 },
35 { ~0x1234567000000000LL
, -4, ~0x01234566 },
37 /* Saturation tests */
39 { +0x4000000000000000LL
, 44, +0x7fffffff },
40 { ~0x4000000000000000LL
, 44, ~0x7fffffff },
41 { +0x0000000000080000LL
, 44, +0x7fffffff },
42 { ~0x0000000000080000LL
, 44, ~0x7fffffff },
43 { +0x000000000007ffffLL
, 44, +0x7ffff000 },
44 { ~0x000000000007ffffLL
, 44, ~0x7fffffff },
45 { +0x000000000007fffeLL
, 44, +0x7fffe000 },
46 { ~0x000000000007fffeLL
, 44, ~0x7fffefff },
48 { +0x4000000000000000LL
, 20, +0x7fffffff },
49 { ~0x4000000000000000LL
, 20, ~0x7fffffff },
50 { +0x0000080000000000LL
, 20, +0x7fffffff },
51 { ~0x0000080000000000LL
, 20, ~0x7fffffff },
52 { +0x000007ffffffffffLL
, 20, +0x7fffffff },
53 { ~0x000007ffffffffffLL
, 20, ~0x7fffffff },
54 { +0x000007fffffff000LL
, 20, +0x7fffffff },
55 { ~0x000007fffffff000LL
, 20, ~0x7ffffffe },
56 { +0x000007ffffffe000LL
, 20, +0x7ffffffe },
57 { ~0x000007ffffffefffLL
, 20, ~0x7ffffffe }
62 for (i
= 0; i
< sizeof (values
) / sizeof (values
[0]); i
++)
64 __IACCsetll (0, values
[i
].value
);
65 if (__SCUTSS (values
[i
].cut_point
) != values
[i
].result
)