Parcourir la source

r600g/sb: silence warnings with gcc 4.8

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
tags/mesa-9.2-rc1
Vadim Girlin il y a 12 ans
Parent
révision
48ba5712f5

+ 11
- 14
src/gallium/drivers/r600/sb/sb_ra_init.cpp Voir le fichier

@@ -75,7 +75,7 @@ public:

void set(unsigned index, unsigned val);

sel_chan find_free_bit(unsigned start);
sel_chan find_free_bit();
sel_chan find_free_chans(unsigned mask);
sel_chan find_free_array(unsigned size, unsigned mask);

@@ -148,24 +148,21 @@ void regbits::set(unsigned index, unsigned val) {
}

// free register for ra means the bit is set
sel_chan regbits::find_free_bit(unsigned start) {
unsigned elt = start >> bt_index_shift;
unsigned bit = start & bt_index_mask;

unsigned end = start < MAX_GPR - num_temps ? MAX_GPR - num_temps : MAX_GPR;
sel_chan regbits::find_free_bit() {
unsigned elt = 0;
unsigned bit = 0;

while (elt < end && !dta[elt]) {
while (elt < size && !dta[elt])
++elt;
bit = 0;
}

if (elt >= end)
if (elt >= size)
return 0;

// FIXME this seems broken when not starting from 0
bit = __builtin_ctz(dta[elt]) + (elt << bt_index_shift);

assert(bit < MAX_GPR - num_temps);

bit += __builtin_ctz(dta[elt]);
return ((elt << bt_index_shift) | bit) + 1;
return bit + 1;
}

// find free gpr component to use as indirectly addressable array
@@ -482,7 +479,7 @@ void ra_init::color(value* v) {
unsigned mask = 1 << v->pin_gpr.chan();
c = rb.find_free_chans(mask) + v->pin_gpr.chan();
} else {
c = rb.find_free_bit(0);
c = rb.find_free_bit();
}

assert(c && c.sel() < 128 - ctx.alu_temp_gprs && "color failed");

+ 4
- 0
src/gallium/drivers/r600/sb/sb_sched.cpp Voir le fichier

@@ -542,6 +542,10 @@ bool alu_group_tracker::try_reserve(alu_node* n) {

assert(first_slot != ~0 && last_slot != ~0);

// silence "array subscript is above array bounds" with gcc 4.8
if (last_slot >= 5)
abort();

int i = first_nf;
alu_node *a = slots[i];
bool backtrack = false;

Chargement…
Annuler
Enregistrer