gcc:
[official-gcc.git] / gcc / testsuite / gcc.target / epiphany / t1068-2.c
blob3baefcb909a1257aaf0900ae426d6b464ad8b7b2
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-common" } */
3 /* ??? we should be able to get down to 4 movt, but first we'll have to
4 teach mov2add about flag handling. Maybe add the code that was removed in
5 r144425 from regmove to postreload; epiphany needs tweaks to the addsi3
6 expander to generate a CC reg clobber in the pass. */
7 /* { dg-final { scan-assembler-times "movt" 6 } } */
9 typedef unsigned int uint32_t;
10 typedef unsigned int uint16_t;
12 struct dma_desc {
13 uint32_t config;
14 uint32_t inner_stride;
15 uint32_t count;
16 uint32_t outer_stride;
17 void *src_addr;
18 void *dst_addr;
20 typedef struct dma_desc e_dma_desc_t;
22 e_dma_desc_t dma;
23 int a;
24 int id[8];
25 #define NULL ((void *)0)
27 static inline void _ez_dma_set(register e_dma_desc_t *dma,
28 uint32_t config,
29 e_dma_desc_t *next,
30 uint16_t inner_src, uint16_t inner_dst,
31 uint16_t inner_count, uint16_t outer_count,
32 uint16_t outer_src, uint16_t outer_dst,
33 void *src, void*dst) {
34 //register e_dma_desc_t *dmap = dma;
36 dma->config = config | (((uint32_t)next)<<16);
37 dma->inner_stride = (inner_dst << 16) | inner_src;
38 dma->count = (inner_count << 16) | outer_count;
39 dma->outer_stride = (outer_dst << 16) | outer_src;
40 dma->src_addr = src;
41 dma->dst_addr = dst;
44 void __attribute__((section(".text.ds1")))
45 dmas_inline1(void) {
46 register e_dma_desc_t *dmap = &dma;
48 _ez_dma_set(dmap, 3, NULL,
49 1, 2,
50 12, 13,
51 5, 1,
52 id, &a);