Stop only if there aren't any usable algorithms
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr45352-2.c
blob47e428c20b042aae51e95b2d63cb7d22bddb818b
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -mtune=amdfam10 -fexpensive-optimizations -fgcse -foptimize-register-move -freorder-blocks -fschedule-insns2 -funswitch-loops -fgcse-las -fselective-scheduling2 -fsel-sched-pipelining -funroll-all-loops" } */
4 typedef char uint8_t;
5 typedef int uint32_t;
6 typedef int vo_frame_t;
7 __extension__ typedef __SIZE_TYPE__ size_t;
9 struct vo_frame_s
11 uint8_t base[3];
12 int pitches[3];};
13 typedef struct
15 void
16 (*proc_macro_block)
17 (void);
19 xine_xvmc_t;
20 typedef struct
22 uint8_t ref[2][3];
23 int pmv;
25 motion_t;
26 typedef struct
28 uint32_t bitstream_buf;
29 int bitstream_bits;
30 uint8_t * bitstream_ptr;
31 uint8_t dest[3];
32 int pitches[3];
33 int offset;
34 motion_t b_motion;
35 motion_t f_motion;
36 int v_offset;
37 int coded_picture_width;
38 int picture_structure;
39 struct vo_frame_s *current_frame;}
40 picture_t;
41 typedef struct
43 int xvmc_last_slice_code;}
44 mpeg2dec_accel_t;
45 static int bitstream_init (picture_t * picture, void *start)
47 picture->bitstream_ptr = start;
48 return (int) (size_t) start;
50 static void slice_xvmc_init (picture_t * picture, int code)
52 int offset;
53 struct vo_frame_s *forward_reference_frame;
54 offset = picture->picture_structure == 2;
55 picture->pitches[0] = picture->current_frame->pitches[0];
56 picture->pitches[1] = picture->current_frame->pitches[1];
57 if (picture)
58 picture->f_motion.ref
59 [0]
60 [0]
61 = (char) (size_t) (forward_reference_frame->base + (offset ? picture->pitches[0] : 0));
62 picture->f_motion.ref[0][1] = (offset);
63 if (picture->picture_structure)
64 picture->pitches[0] <<= picture->pitches[1] <<= 1;
65 offset = 0;
66 while (1)
68 if (picture->bitstream_buf >= 0x08000000)
69 break;
70 switch (picture->bitstream_buf >> 12)
72 case 8:
73 offset += 33;
74 picture->bitstream_buf
76 picture->bitstream_ptr[1] << picture->bitstream_bits;
79 picture->offset = (offset);
80 while (picture->offset - picture->coded_picture_width >= 0)
82 picture->offset -= picture->coded_picture_width;
83 if (picture->current_frame)
85 picture->dest[0] += picture->pitches[0];
86 picture->dest[1] += picture->pitches[1];
88 picture->v_offset += 16;
92 void
93 mpeg2_xvmc_slice
94 (mpeg2dec_accel_t * accel, picture_t * picture, int code, uint8_t buffer,int mba_inc)
96 xine_xvmc_t * xvmc = (xine_xvmc_t *) (size_t) bitstream_init (picture, (void *) (size_t) buffer);
97 slice_xvmc_init (picture, code);
98 while (1)
100 if (picture)
101 break;
102 switch (picture->bitstream_buf)
104 case 8:
105 mba_inc += accel->xvmc_last_slice_code = code;
106 xvmc->proc_macro_block ();
107 while (mba_inc)