diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.c-torture/compile/pr42705.c | |
download | cbb-gcc-4.6.4-upstream.tar.bz2 cbb-gcc-4.6.4-upstream.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/pr42705.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr42705.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr42705.c b/gcc/testsuite/gcc.c-torture/compile/pr42705.c new file mode 100644 index 000000000..3d7b22da8 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr42705.c @@ -0,0 +1,58 @@ +typedef int GLint; +typedef unsigned char GLubyte; +typedef unsigned int uint32_t; +struct radeon_bo { + void *ptr; + uint32_t flags; +}; +struct radeon_renderbuffer { + struct radeon_bo *bo; + unsigned int cpp; + int has_surface; +}; +static inline +GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb, + GLint x, GLint y, GLint is_depth, GLint is_stencil) +{ + GLint element_bytes = rrb->cpp; + GLint num_samples = 1; + GLint tile_width = 8; + GLint tile_height = 8; + GLint tile_thickness = 1; + GLint tile_bytes; + GLint tiles_per_row; + GLint slice_offset; + GLint tile_row_index; + GLint tile_column_index; + GLint tile_offset; + GLint pixel_number = 0; + GLint element_offset; + GLint offset = 0; + tile_bytes = tile_width * tile_height * tile_thickness + * element_bytes * num_samples; + tile_column_index = x / tile_width; + tile_offset = ((tile_row_index * tiles_per_row) + + tile_column_index) * tile_bytes; + if (is_depth) { + } + else { + GLint sample_offset; + switch (element_bytes) { + case 1: pixel_number |= ((x >> 0) & 1) << 0; + } + element_offset = sample_offset + (pixel_number * element_bytes); + } + offset = slice_offset + tile_offset + element_offset; + return offset; +} +GLubyte *r600_ptr_color(const struct radeon_renderbuffer * rrb, + GLint x, GLint y) +{ + GLubyte *ptr = rrb->bo->ptr; + uint32_t mask = 1 | 2; + GLint offset; + if (rrb->has_surface || !(rrb->bo->flags & mask)) { + offset = r600_1d_tile_helper(rrb, x, y, 0, 0); + } + return &ptr[offset]; +} |