* important, we also get exact results for 0.0 and 1.0.
*/
- unsigned n = MIN2(src_type.width - 1, dst_width);
+ unsigned n = MIN2(src_type.width - 1u, dst_width);
double scale = (double)(1ULL << n);
unsigned lshift = dst_width - n;
unsigned num_srcs,
LLVMValueRef *dst)
{
- int i;
+ unsigned i;
int num_dsts = num_srcs;
if (src_type.floating == dst_type->floating &&
LLVMValueRef cond;
LLVMValueRef res;
- assert(func >= PIPE_FUNC_NEVER);
- assert(func <= PIPE_FUNC_ALWAYS);
assert(lp_check_value(type, a));
assert(lp_check_value(type, b));
if(func == PIPE_FUNC_ALWAYS)
return ones;
+ assert(func > PIPE_FUNC_NEVER);
+ assert(func < PIPE_FUNC_ALWAYS);
+
if(type.floating) {
LLVMRealPredicate op;
switch(func) {
LLVMValueRef zeros = LLVMConstNull(int_vec_type);
LLVMValueRef ones = LLVMConstAllOnes(int_vec_type);
- assert(func >= PIPE_FUNC_NEVER);
- assert(func <= PIPE_FUNC_ALWAYS);
assert(lp_check_value(type, a));
assert(lp_check_value(type, b));
if(func == PIPE_FUNC_ALWAYS)
return ones;
+ assert(func > PIPE_FUNC_NEVER);
+ assert(func < PIPE_FUNC_ALWAYS);
+
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
/*
* There are no unsigned integer comparison instructions in SSE.
unsigned num_dsts)
{
int size = num_srcs / num_dsts;
- int i;
+ unsigned i;
assert(num_srcs >= num_dsts);
assert((num_srcs % size) == 0);
}
-static int
+static unsigned
lp_get_printf_arg_count(const char *fmt)
{
- int count =0;
+ unsigned count = 0;
const char *p = fmt;
int c;
{
LLVMValueRef params[50];
va_list arglist;
- int argcount;
- int i;
+ unsigned argcount, i;
argcount = lp_get_printf_arg_count(fmt);
assert(ARRAY_SIZE(params) >= argcount + 1);
LLVMValueRef res;
struct lp_type type4;
unsigned cond = 0;
- unsigned chan;
+ int chan;
int shift;
/*
enum tgsi_opcode_type stype = tgsi_opcode_infer_src_type(inst->Instruction.Opcode);
if (chan_index == LP_CHAN_ALL) {
- swizzle = ~0;
+ swizzle = ~0u;
} else {
swizzle = tgsi_util_get_full_src_register_swizzle(reg, chan_index);
if (swizzle > 3) {
* Swizzle the argument
*/
- if (swizzle == ~0) {
+ if (swizzle == ~0u) {
res = bld_base->emit_swizzle(bld_base, res,
reg->Register.SwizzleX,
reg->Register.SwizzleY,
* Swizzle the argument
*/
- if (swizzle == ~0) {
+ if (swizzle == ~0u) {
res = bld_base->emit_swizzle(bld_base, res,
off->SwizzleX,
off->SwizzleY,
extern "C" {
#endif
-#define LP_CHAN_ALL ~0
+#define LP_CHAN_ALL ~0u
#define LP_MAX_INSTRUCTIONS 256
{
unsigned pc = bld_base->pc;
struct function_ctx *ctx = func_ctx(mask);
- unsigned curr_switch_stack = ctx->switch_stack_size;
+ int curr_switch_stack = ctx->switch_stack_size;
if (ctx->switch_stack_size > LP_MAX_TGSI_NESTING) {
return false;
pc++;
}
- while (pc != -1 && pc < bld_base->num_instructions) {
+ while (pc != ~0u && pc < bld_base->num_instructions) {
unsigned opcode = bld_base->instructions[pc].Instruction.Opcode;
switch (opcode) {
case TGSI_OPCODE_CASE:
static LLVMValueRef
get_file_ptr(struct lp_build_tgsi_soa_context *bld,
unsigned file,
- unsigned index,
+ int index,
unsigned chan)
{
LLVMBuilderRef builder = bld->bld_base.base.gallivm->builder;
LLVMValueRef res;
/* XXX: Handle fetching xyzw components as a vector */
- assert(swizzle != ~0);
+ assert(swizzle != ~0u);
if (reg->Register.Dimension) {
assert(!reg->Dimension.Indirect);
int chan;
if (index < 8 * sizeof(unsigned) &&
- (info->file_mask[file] & (1 << index)) == 0) {
+ (info->file_mask[file] & (1u << index)) == 0) {
/* This was not declared.*/
continue;
}