Commit 9e66090f authored by Lyude Paul's avatar Lyude Paul

Kill all extra whitespace

my editor highlights this. I must.
parent bd836eb5
......@@ -350,7 +350,7 @@ static const FMAOpInfo FMAOpInfos[] = {
// and x1 is a floating point value in a predetermined range where the
// value 1 is within the range and not at one extremity of the range (e.g.
// choose a range where 1 is towards middle of range)."
//
//
// This computes x1.
{ 0xe0345, "LOG_FREXPM", FMAOneSrc },
{ 0xe0365, "FRCP_TABLE", FMAOneSrc },
......@@ -595,7 +595,7 @@ static const ADDOpInfo ADDOpInfos[] = {
// and x1 is a floating point value in a predetermined range where the
// value 1 is within the range and not at one extremity of the range (e.g.
// choose a range where 1 is towards middle of range)."
//
//
// This computes s.
{ 0x07bc5, "FLOG_FREXPE", ADDOneSrc },
{ 0x07d45, "CEIL", ADDOneSrc },
......@@ -898,7 +898,7 @@ static void DumpADD(uint64_t word, Regs regs, Regs nextRegs, uint64_t *consts, u
printf(", ");
DumpSrc(ADD.src0, regs, consts, false);
break;
}
}
case ADDTwoSrc:
DumpSrc(ADD.src0, regs, consts, false);
printf(", ");
......
......@@ -182,7 +182,7 @@ bool ParseSingleBlock(unsigned indent, uint8_t* blockBlob, uint32_t cookie, uint
assert(*reinterpret_cast<uint32_t*>(blockBlob) == COOKIE("RLOC"));
PrintBlock(indent + 1, &blockBlob);
}
// Finally, 8 more bytes
Block_SYMB_pt2 *pt2 = reinterpret_cast<Block_SYMB_pt2*>(blockBlob);
iprintf(indent + 1, "unk4 = 0x%08x\n", pt2->unk4);
......
......@@ -212,14 +212,14 @@ static void print_vector_src(unsigned src_binary, bool out_high,
bool out_half, unsigned reg)
{
lima_t6xx_vector_alu_src_t* src = (lima_t6xx_vector_alu_src_t*)&src_binary;
if (src->negate)
printf("-");
if (src->abs)
printf("abs(");
//register
if (out_half)
{
unsigned half_reg;
......@@ -246,20 +246,20 @@ static void print_vector_src(unsigned src_binary, bool out_high,
else
print_reg(reg, false);
}
//swizzle
if (src->swizzle != 0xE4) //default swizzle
{
unsigned i;
static const char c[4] = "xyzw";
printf(".");
for (i = 0; i < 4; i++)
printf("%c", c[(src->swizzle >> (i * 2)) & 3]);
}
if (src->abs)
printf(")");
}
......@@ -278,7 +278,7 @@ static void print_vector_field(const char *name, uint16_t* words, uint16_t reg_w
{
lima_t6xx_reg_info_t* reg_info = (lima_t6xx_reg_info_t*)&reg_word;
lima_t6xx_vector_alu_t* alu_field = (lima_t6xx_vector_alu_t*) words;
if (alu_field->reg_mode != lima_t6xx_reg_mode_half &&
alu_field->reg_mode != lima_t6xx_reg_mode_full)
{
......@@ -294,12 +294,12 @@ static void print_vector_field(const char *name, uint16_t* words, uint16_t reg_w
print_alu_opcode(alu_field->op);
print_outmod(alu_field->outmod);
printf(" ");
bool half, out_half, out_high;
unsigned mask;
half = (alu_field->reg_mode == lima_t6xx_reg_mode_half);
if (half)
{
if (alu_field->mask & 0xF)
......@@ -321,9 +321,9 @@ static void print_vector_field(const char *name, uint16_t* words, uint16_t reg_w
mask |= (alu_field->mask & 16) >> 2;
mask |= (alu_field->mask & 64) >> 3;
}
out_half = half;
if (alu_field->dest_override != lima_t6xx_dest_override_none)
{
assert(!out_half);
......@@ -335,7 +335,7 @@ static void print_vector_field(const char *name, uint16_t* words, uint16_t reg_w
else
assert(0);
}
if (out_half)
{
if (out_high)
......@@ -345,24 +345,24 @@ static void print_vector_field(const char *name, uint16_t* words, uint16_t reg_w
}
else
print_reg(reg_info->out_reg, false);
if (mask != 0xF)
{
unsigned i;
static const char c[4] = "xyzw";
printf(".");
for (i = 0; i < 4; i++)
if (mask & (1 << i))
printf("%c", c[i]);
}
printf(", ");
print_vector_src(alu_field->src1, out_high, half, reg_info->src1_reg);
printf(", ");
if (reg_info->src2_imm)
{
uint16_t imm = decode_vector_imm(reg_info->src2_reg,
......@@ -374,30 +374,30 @@ static void print_vector_field(const char *name, uint16_t* words, uint16_t reg_w
print_vector_src(alu_field->src2, out_high, half,
reg_info->src2_reg);
}
printf("\n");
}
static void print_scalar_src(unsigned src_binary, unsigned reg)
{
lima_t6xx_scalar_alu_src_t* src = (lima_t6xx_scalar_alu_src_t*)&src_binary;
if (src->negate)
printf("-");
if (src->abs)
printf("abs(");
if (src->full)
print_reg(reg, false);
else
print_reg(reg * 2 + (src->component >> 2), true);
static const char c[4] = "xyzw";\
printf(".%c", c[src->full ? src->component >> 1 : src->component & 3]);
if (src->abs)
printf(")");
}
static uint16_t decode_scalar_imm(unsigned src2_reg, unsigned imm)
......@@ -416,7 +416,7 @@ static void print_scalar_field(const char *name, uint16_t* words, uint16_t reg_w
{
lima_t6xx_reg_info_t* reg_info = (lima_t6xx_reg_info_t*)&reg_word;
lima_t6xx_scalar_alu_t* alu_field = (lima_t6xx_scalar_alu_t*) words;
if (alu_field->unknown)
{
ogt_asm_print_tabs(tabs);
......@@ -428,22 +428,22 @@ static void print_scalar_field(const char *name, uint16_t* words, uint16_t reg_w
print_alu_opcode(alu_field->op);
print_outmod(alu_field->outmod);
printf(" ");
if (alu_field->output_full)
print_reg(reg_info->out_reg, false);
else
print_reg(reg_info->out_reg * 2 + (alu_field->output_component >> 2),
true);
static const char c[4] = "xyzw";
printf(".%c, ",
c[alu_field->output_full ? alu_field->output_component >> 1 :
alu_field->output_component & 3]);
print_scalar_src(alu_field->src1, reg_info->src1_reg);
printf(", ");
if (reg_info->src2_imm)
{
uint16_t imm = decode_scalar_imm(reg_info->src2_reg,
......@@ -452,7 +452,7 @@ static void print_scalar_field(const char *name, uint16_t* words, uint16_t reg_w
}
else
print_scalar_src(alu_field->src2, reg_info->src2_reg);
printf("\n");
}
......@@ -504,22 +504,22 @@ static void print_compact_branch_writeout_field(uint16_t word)
static unsigned num_alu_fields_enabled(uint32_t control_word)
{
unsigned ret = 0;
if ((control_word >> 17) & 1)
ret++;
if ((control_word >> 19) & 1)
ret++;
if ((control_word >> 21) & 1)
ret++;
if ((control_word >> 23) & 1)
ret++;
if ((control_word >> 25) & 1)
ret++;
return ret;
}
......@@ -529,7 +529,7 @@ static float float_bitcast(uint32_t integer)
uint32_t i;
float f;
} v;
v.i = integer;
return v.f;
}
......@@ -541,19 +541,19 @@ static void print_alu_word(uint32_t* words, unsigned num_quad_words,
for (i = 0; i < num_quad_words; i++)
print_quad_word(&words[4*i], tabs);
#endif
uint32_t control_word = words[0];
uint16_t* beginning_ptr = (uint16_t*)(words + 1);
unsigned num_fields = num_alu_fields_enabled(control_word);
uint16_t* word_ptr = beginning_ptr + num_fields;
unsigned num_words = 2 + num_fields;
if ((control_word >> 16) & 1)
{
ogt_asm_print_tabs(tabs);
printf("unknown bit 16 enabled\n");
}
if ((control_word >> 17) & 1)
{
print_vector_field("vmul", word_ptr, *beginning_ptr, tabs);
......@@ -561,13 +561,13 @@ static void print_alu_word(uint32_t* words, unsigned num_quad_words,
word_ptr += 3;
num_words += 3;
}
if ((control_word >> 18) & 1)
{
ogt_asm_print_tabs(tabs);
printf("unknown bit 18 enabled\n");
}
if ((control_word >> 19) & 1)
{
print_scalar_field("sadd", word_ptr, *beginning_ptr, tabs);
......@@ -575,13 +575,13 @@ static void print_alu_word(uint32_t* words, unsigned num_quad_words,
word_ptr += 2;
num_words += 2;
}
if ((control_word >> 20) & 1)
{
ogt_asm_print_tabs(tabs);
printf("unknown bit 20 enabled\n");
}
if ((control_word >> 21) & 1)
{
print_vector_field("vadd", word_ptr, *beginning_ptr, tabs);
......@@ -589,13 +589,13 @@ static void print_alu_word(uint32_t* words, unsigned num_quad_words,
word_ptr += 3;
num_words += 3;
}
if ((control_word >> 22) & 1)
{
ogt_asm_print_tabs(tabs);
printf("unknown bit 22 enabled\n");
}
if ((control_word >> 23) & 1)
{
print_scalar_field("smul", word_ptr, *beginning_ptr, tabs);
......@@ -603,13 +603,13 @@ static void print_alu_word(uint32_t* words, unsigned num_quad_words,
word_ptr += 2;
num_words += 2;
}
if ((control_word >> 24) & 1)
{
ogt_asm_print_tabs(tabs);
printf("unknown bit 24 enabled\n");
}
if ((control_word >> 25) & 1)
{
print_vector_field("lut", word_ptr, *beginning_ptr, tabs);
......@@ -617,7 +617,7 @@ static void print_alu_word(uint32_t* words, unsigned num_quad_words,
word_ptr += 3;
num_words += 3;
}
if ((control_word >> 26) & 1)
{
print_compact_branch_writeout_field(*word_ptr);
......@@ -625,7 +625,7 @@ static void print_alu_word(uint32_t* words, unsigned num_quad_words,
word_ptr += 1;
num_words += 1;
}
if ((control_word >> 27) & 1)
{
ogt_asm_print_tabs(tabs);
......@@ -635,7 +635,7 @@ static void print_alu_word(uint32_t* words, unsigned num_quad_words,
word_ptr += 3;
num_words += 3;
}
if (num_quad_words > (num_words + 7) / 8)
{
assert(num_quad_words == (num_words + 15) / 8);
......@@ -723,8 +723,8 @@ static void print_load_store_instr(uint64_t data,
ogt_asm_print_tabs(tabs);
print_ld_st_opcode(word->op);
printf(" r%d", word->reg);
print_mask(word->mask);
print_mask(word->mask);
printf(", %d", word->address);
print_swizzle(word->swizzle);
......@@ -734,7 +734,7 @@ static void print_load_store_instr(uint64_t data,
static void print_load_store_word(uint32_t* word, unsigned tabs)
{
lima_t6xx_load_store_t* load_store = (lima_t6xx_load_store_t *) word;
if (load_store->word1 != 3)
{
print_load_store_instr(load_store->word1, tabs);
......@@ -809,7 +809,7 @@ static void print_texture_word(uint32_t* word, unsigned tabs)
if (!texture->filter)
printf(".raw");
if (texture->shadow)
printf(".shadow");
......@@ -819,16 +819,16 @@ static void print_texture_word(uint32_t* word, unsigned tabs)
if (texture->last)
printf(".last");
/* Second set are modifiers which take an extra argument each */
/* Second set are modifiers which take an extra argument each */
if (texture->has_offset)
printf(".offset");
if (texture->bias)
printf(".bias");
printf(" ");
printf(" ");
print_texture_reg(texture->out_full, texture->out_reg_select, texture->out_upper);
print_mask(texture->mask);
printf(", ");
......@@ -907,7 +907,7 @@ void DisassembleMidgard(uint8_t* code, uint32_t size)
int tabs = 0;
bool prefetch_flag = false;
unsigned i = 0;
while (i < num_words)
{
......@@ -917,11 +917,11 @@ void DisassembleMidgard(uint8_t* code, uint32_t size)
case lima_t6xx_word_type_texture:
print_texture_word(&words[i], tabs);
break;
case lima_t6xx_word_type_load_store:
print_load_store_word(&words[i], tabs);
break;
case lima_t6xx_word_type_alu:
print_alu_word(&words[i], num_quad_words, tabs);
......@@ -933,7 +933,7 @@ void DisassembleMidgard(uint8_t* code, uint32_t size)
is_embedded_constant_int = false;
break;
default:
printf("Unknown word type %u:\n", words[i] & 0xF);
num_quad_words = 1;
......@@ -957,6 +957,6 @@ void DisassembleMidgard(uint8_t* code, uint32_t size)
return;
}
}
return;
}
......@@ -2,14 +2,14 @@
* Ben Brewer (ben.brewer@codethink.co.uk)
*
* Copyright (c) 2013 Codethink (http://www.codethink.co.uk)
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
......
......@@ -3,14 +3,14 @@
*
* Copyright (c) 2013
* Codethink (http://www.codethink.co.uk)
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
......
......@@ -125,7 +125,7 @@ __attribute__((__packed__))
{
bool abs : 1;
bool negate : 1;
/* replicate lower half if dest = half, or low/high half selection if
* dest = full
*/
......@@ -319,7 +319,7 @@ __attribute__((__packed__))
unsigned offset_unknown9 : 1;
unsigned unknownB : 3;
/* Texture bias or LOD, depending on whether it is executed in a
* fragment/vertex shader respectively. Compute as int(2^8 * biasf).
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment