1 extern void abort (void) __attribute__ ((noreturn
));
5 void __attribute__ ((weak
, optimize ("no-tree-vectorize")))
6 test (int n
, int m
, int offset
)
8 int abs_n
= (n
< 0 ? -n
: n
);
9 int abs_m
= (m
< 0 ? -m
: m
);
10 int max_i
= (abs_n
> abs_m
? abs_n
: abs_m
);
11 int abs_offset
= (offset
< 0 ? -offset
: offset
);
12 int size
= MARGIN
* 2 + max_i
* SIZE
+ abs_offset
;
13 TYPE
*array
= (TYPE
*) __builtin_alloca (size
* sizeof (TYPE
));
14 for (int i
= 0; i
< size
; ++i
)
16 int base_x
= offset
< 0 ? MARGIN
- offset
: MARGIN
;
17 int base_y
= offset
< 0 ? MARGIN
: MARGIN
+ offset
;
18 int start_x
= n
< 0 ? base_x
- n
* (SIZE
- 1) : base_x
;
19 int start_y
= m
< 0 ? base_y
- m
* (SIZE
- 1) : base_y
;
20 f (&array
[start_x
], &array
[start_y
], n
, m
);
22 int start
= (n
< 0 ? size
- 1 : 0);
23 int end
= (n
< 0 ? -1 : size
);
24 int inc
= (n
< 0 ? -1 : 1);
25 for (int i
= start
; i
!= end
; i
+= inc
)
27 if (j
== SIZE
|| i
!= start_x
+ j
* n
)
37 int next_y
= start_y
+ j
* m
;
38 if (n
>= 0 ? next_y
< i
: next_y
> i
)
50 int next_y
= start_y
+ j
* m
;
52 if (n
>= 0 ? next_y
< i
: next_y
> i
)
53 base
+= array
[next_y
];