r600g/sb: use hex instead of binary constants
authorVadim Girlin <vadimgirlin@gmail.com>
Wed, 1 May 2013 17:33:33 +0000 (21:33 +0400)
committerVadim Girlin <vadimgirlin@gmail.com>
Fri, 3 May 2013 12:53:41 +0000 (16:53 +0400)
This should fix build issues with GCC < 4.3

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
src/gallium/drivers/r600/r600_shader.c
src/gallium/drivers/r600/sb/sb_bc.h
src/gallium/drivers/r600/sb/sb_bc_parser.cpp
src/gallium/drivers/r600/sb/sb_ra_init.cpp
src/gallium/drivers/r600/sb/sb_sched.cpp

index ab05b5ac997c889fc9f65664d3cb9edd989f117f..9afd57f71a241098f76639c6e0a811c0a29351ac 100644 (file)
@@ -1001,7 +1001,7 @@ static int tgsi_declaration(struct r600_shader_ctx *ctx)
                                r600_add_gpr_array(ctx->shader,
                                               ctx->file_offset[TGSI_FILE_TEMPORARY] +
                                                                   d->Range.First,
-                                              d->Range.Last - d->Range.First + 1, 0b1111);
+                                              d->Range.Last - d->Range.First + 1, 0x0F);
                        }
                }
                break;
@@ -1417,13 +1417,13 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen,
                        r600_add_gpr_array(shader, ctx.file_offset[TGSI_FILE_INPUT],
                                           ctx.file_offset[TGSI_FILE_OUTPUT] -
                                           ctx.file_offset[TGSI_FILE_INPUT],
-                                          0b1111);
+                                          0x0F);
                }
                if (ctx.info.indirect_files & (1 << TGSI_FILE_OUTPUT)) {
                        r600_add_gpr_array(shader, ctx.file_offset[TGSI_FILE_OUTPUT],
                                           ctx.file_offset[TGSI_FILE_TEMPORARY] -
                                           ctx.file_offset[TGSI_FILE_OUTPUT],
-                                          0b1111);
+                                          0x0F);
                }
        }
 
index 0b9bc07085ca48d2c0f6ce8fbf0dc21944c09561..9c6ed46d051c28309b94b6de6d49df1f8317e641 100644 (file)
@@ -553,9 +553,9 @@ public:
                unsigned mask = 0;
                unsigned slot_flags = alu_slots(op_ptr);
                if (slot_flags & AF_V)
-                       mask = 0b01111;
+                       mask = 0x0F;
                if (!is_cayman() && (slot_flags & AF_S))
-                       mask |= 0b10000;
+                       mask |= 0x10;
                return mask;
        }
 
index cc7552827b98106d1b8b2f7adf96bfec878bb997..e1478d380dd560cb4b73c6644b2f6fc5cd7f3949 100644 (file)
@@ -126,7 +126,7 @@ int bc_parser::parse_decls() {
 
 #if SB_NO_ARRAY_INFO
 
-               sh->add_gpr_array(0, pshader->bc.ngpr, 0b1111);
+               sh->add_gpr_array(0, pshader->bc.ngpr, 0x0F);
 
 #else
 
@@ -140,7 +140,7 @@ int bc_parser::parse_decls() {
                        }
 
                } else {
-                       sh->add_gpr_array(0, pshader->bc.ngpr, 0b1111);
+                       sh->add_gpr_array(0, pshader->bc.ngpr, 0x0F);
                }
 
 
@@ -149,7 +149,7 @@ int bc_parser::parse_decls() {
        }
 
        if (sh->target == TARGET_VS)
-               sh->add_input(0, 1, 0b1111);
+               sh->add_input(0, 1, 0x0F);
 
        bool ps_interp = ctx.hw_class >= HW_CLASS_EVERGREEN
                        && sh->target == TARGET_PS;
@@ -159,7 +159,7 @@ int bc_parser::parse_decls() {
        for (unsigned i = 0; i < pshader->ninput; ++i) {
                r600_shader_io & in = pshader->input[i];
                bool preloaded = sh->target == TARGET_PS && !(ps_interp && in.spi_sid);
-               sh->add_input(in.gpr, preloaded, /*in.write_mask*/ 0b1111);
+               sh->add_input(in.gpr, preloaded, /*in.write_mask*/ 0x0F);
                if (ps_interp && in.spi_sid) {
                        if (in.interpolate == TGSI_INTERPOLATE_LINEAR ||
                                        in.interpolate == TGSI_INTERPOLATE_COLOR)
@@ -176,7 +176,7 @@ int bc_parser::parse_decls() {
                unsigned gpr = 0;
 
                while (mask) {
-                       sh->add_input(gpr, true, mask & 0b1111);
+                       sh->add_input(gpr, true, mask & 0x0F);
                        ++gpr;
                        mask >>= 4;
                }
index 75b2d5d9a0cfe1e55b1b219ecdf070222d34b882..0447f29eb1b99e06e2c7acaa71c23514a538a017 100644 (file)
@@ -360,7 +360,7 @@ void ra_init::color_bs_constraint(ra_constraint* c) {
        regbits rb(ctx.alu_temp_gprs);
 
        unsigned chan_count[4] = {};
-       unsigned allowed_chans = 0b1111;
+       unsigned allowed_chans = 0x0F;
 
        for (vvec::iterator I = vv.begin(), E = vv.end(); I != E; ++I) {
                value *v = *I;
index 06c362a861ff89ad898f759b138ed3e48d4eb7eb..7e9eaccfcd3b9d50412dee726ccd65b6d8e0ddc1 100644 (file)
@@ -312,7 +312,7 @@ alu_group_tracker::alu_group_tracker(shader &sh)
          has_mova(), uses_ar(), has_predset(), has_kill(),
          updates_exec_mask(), chan_count(), interp_param(), next_id() {
 
-       available_slots = sh.get_ctx().has_trans ? 0b11111 : 0b01111;
+       available_slots = sh.get_ctx().has_trans ? 0x1F : 0x0F;
 }
 
 inline
@@ -678,7 +678,7 @@ void alu_group_tracker::reset(bool keep_packed) {
        has_predset = false;
        has_kill = false;
        updates_exec_mask = false;
-       available_slots = sh.get_ctx().has_trans ? 0b11111 : 0b01111;
+       available_slots = sh.get_ctx().has_trans ? 0x1F : 0x0F;
        interp_param = 0;
 
        chan_count[0] = 0;
@@ -1471,7 +1471,7 @@ unsigned post_scheduler::try_add_instruction(node *n) {
                if (d) {
                        slot = d->get_final_chan();
                        a->bc.dst_chan = slot;
-                       allowed_slots &= (1 << slot) | 0b10000;
+                       allowed_slots &= (1 << slot) | 0x10;
                } else {
                        if (a->bc.op_ptr->flags & AF_MOVA) {
                                if (a->bc.slot_flags & AF_V)
@@ -1484,7 +1484,7 @@ unsigned post_scheduler::try_add_instruction(node *n) {
                // FIXME workaround for some problems with MULADD in trans slot on r700,
                // (is it really needed on r600?)
                if (a->bc.op == ALU_OP3_MULADD && !ctx.is_egcm()) {
-                       allowed_slots &= 0b01111;
+                       allowed_slots &= 0x0F;
                }
 
                if (!allowed_slots) {