annotate gcc/testsuite/gcc.c-torture/compile/pr44063.c @ 131:84e7813d76e9

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