annotate gcc/testsuite/gcc.c-torture/compile/pr44063.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
1 /* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
2
111
kono
parents:
diff changeset
3 typedef signed char int8_t;
kono
parents:
diff changeset
4 typedef short int16_t;
kono
parents:
diff changeset
5 typedef unsigned char uint8_t;
kono
parents:
diff changeset
6 typedef unsigned int uint32_t;
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 union unaligned_32 {uint32_t l;} __attribute__((packed)) __attribute__((may_alias));
kono
parents:
diff changeset
9 static inline uint32_t NEG_USR32(uint32_t a, int8_t s){return a << (32 - s);}
kono
parents:
diff changeset
10 typedef struct GetBitContext { const uint8_t *buffer, *buffer_end; int index;}GetBitContext;
kono
parents:
diff changeset
11 typedef struct VLC {int16_t (*table)[2];} VLC;
kono
parents:
diff changeset
12 static __attribute__((always_inline)) inline int get_vlc2(GetBitContext *s, int16_t (*table)[2], int bits, int max_depth) {
kono
parents:
diff changeset
13 unsigned int re_index= (s)->index;
kono
parents:
diff changeset
14 int re_cache= 0;
kono
parents:
diff changeset
15 {
kono
parents:
diff changeset
16 int n, nb_bits;
kono
parents:
diff changeset
17 unsigned int index;
kono
parents:
diff changeset
18 index= NEG_USR32(re_cache, bits);
kono
parents:
diff changeset
19 n = table[index][1];
kono
parents:
diff changeset
20 if(max_depth > 1 && n < 0){
kono
parents:
diff changeset
21 re_cache= bswap_32((((const union unaligned_32 *) (((const uint8_t *)(s)->buffer)+(re_index>>3)))->l)) << (re_index&0x07);
kono
parents:
diff changeset
22 }
kono
parents:
diff changeset
23 }
kono
parents:
diff changeset
24 }
kono
parents:
diff changeset
25 typedef struct HYuvContext{GetBitContext gb; int decorrelate; int bitstream_bpp; uint8_t *temp[3]; VLC vlc[6];} HYuvContext;
kono
parents:
diff changeset
26 static __attribute__((always_inline)) inline void decode_bgr_1(HYuvContext *s, int count, int decorrelate, int alpha){
kono
parents:
diff changeset
27 int i;
kono
parents:
diff changeset
28 int code = get_vlc2(&s->gb, s->vlc[3].table, 11, 1);
kono
parents:
diff changeset
29 if(code != -1){
kono
parents:
diff changeset
30 s->temp[0][4*i+0] = get_vlc2(&s->gb, s->vlc[0].table, 11, 3);
kono
parents:
diff changeset
31 s->temp[0][4*i+1] = get_vlc2(&s->gb, s->vlc[1].table, 11, 3);
kono
parents:
diff changeset
32 s->temp[0][4*i+2] = get_vlc2(&s->gb, s->vlc[2].table, 11, 3);
kono
parents:
diff changeset
33 }
kono
parents:
diff changeset
34 }
kono
parents:
diff changeset
35 void decode_bgr_bitstream(HYuvContext *s, int count){
kono
parents:
diff changeset
36 if(s->decorrelate){
kono
parents:
diff changeset
37 if(s->bitstream_bpp==24) decode_bgr_1(s, count, 1, 0);
kono
parents:
diff changeset
38 else decode_bgr_1(s, count, 1, 1);
kono
parents:
diff changeset
39 }
kono
parents:
diff changeset
40 }