do away with 'long long' usage

This commit is contained in:
Brian Paul
2005-12-08 14:50:03 +00:00
parent 5262c225ba
commit 91ed68b2b9
2 changed files with 11 additions and 14 deletions

View File

@@ -749,7 +749,7 @@ static void (* const opcode_func[MAX_OPCODE+3])(struct arb_vp_machine *, union i
static union instruction *cvp_next_instruction( struct compilation *cp ) static union instruction *cvp_next_instruction( struct compilation *cp )
{ {
union instruction *op = cp->csr++; union instruction *op = cp->csr++;
op->dword = 0; _mesa_bzero(op, sizeof(*op));
return op; return op;
} }
@@ -836,28 +836,29 @@ static struct reg cvp_emit_arg( struct compilation *cp,
/* Emit any necessary swizzling. /* Emit any necessary swizzling.
*/ */
rsw.dword = 0; _mesa_bzero(&rsw, sizeof(rsw));
rsw.rsw.neg = src->NegateBase ? WRITEMASK_XYZW : 0; rsw.rsw.neg = src->NegateBase ? WRITEMASK_XYZW : 0;
/* we're expecting 2-bit swizzles below... */ /* we're expecting 2-bit swizzles below... */
#if 1 /* XXX THESE ASSERTIONS CURRENTLY FAIL DURING GLEAN TESTS! */
ASSERT(GET_SWZ(src->Swizzle, 0) < 4); ASSERT(GET_SWZ(src->Swizzle, 0) < 4);
ASSERT(GET_SWZ(src->Swizzle, 1) < 4); ASSERT(GET_SWZ(src->Swizzle, 1) < 4);
ASSERT(GET_SWZ(src->Swizzle, 2) < 4); ASSERT(GET_SWZ(src->Swizzle, 2) < 4);
ASSERT(GET_SWZ(src->Swizzle, 3) < 4); ASSERT(GET_SWZ(src->Swizzle, 3) < 4);
#endif
rsw.rsw.swz = ((GET_SWZ(src->Swizzle, 0) << 0) | rsw.rsw.swz = ((GET_SWZ(src->Swizzle, 0) << 0) |
(GET_SWZ(src->Swizzle, 1) << 2) | (GET_SWZ(src->Swizzle, 1) << 2) |
(GET_SWZ(src->Swizzle, 2) << 4) | (GET_SWZ(src->Swizzle, 2) << 4) |
(GET_SWZ(src->Swizzle, 3) << 6)); (GET_SWZ(src->Swizzle, 3) << 6));
noop.dword = 0; _mesa_bzero(&noop, sizeof(noop));
noop.rsw.neg = 0; noop.rsw.neg = 0;
noop.rsw.swz = RSW_NOOP; noop.rsw.swz = RSW_NOOP;
if (rsw.dword != noop.dword) { if (_mesa_memcmp(&rsw, &noop, sizeof(rsw)) !=0) {
union instruction *op = cvp_next_instruction(cp); union instruction *op = cvp_next_instruction(cp);
struct reg rsw_reg = cvp_make_reg(FILE_REG, REG_ARG0 + arg); struct reg rsw_reg = cvp_make_reg(FILE_REG, REG_ARG0 + arg);
op->dword = rsw.dword; *op = rsw;
op->rsw.opcode = RSW; op->rsw.opcode = RSW;
op->rsw.file0 = reg.file; op->rsw.file0 = reg.file;
op->rsw.idx0 = reg.idx; op->rsw.idx0 = reg.idx;
@@ -900,7 +901,7 @@ static GLuint cvp_choose_result( struct compilation *cp,
return REG_RES; return REG_RES;
} }
else { else {
fixup->dword = 0; _mesa_bzero(fixup, sizeof(*fixup));
cp->reg_active |= 1 << idx; cp->reg_active |= 1 << idx;
return idx; return idx;
} }
@@ -955,8 +956,6 @@ static void cvp_emit_inst( struct compilation *cp,
struct reg reg[3]; struct reg reg[3];
GLuint result, nr_args, i; GLuint result, nr_args, i;
assert(sizeof(*op) == sizeof(MESA_LONGLONG));
/* Need to handle SWZ, ARL specially. /* Need to handle SWZ, ARL specially.
*/ */
switch (inst->Opcode) { switch (inst->Opcode) {
@@ -985,7 +984,7 @@ static void cvp_emit_inst( struct compilation *cp,
if (result == REG_RES) { if (result == REG_RES) {
op = cvp_next_instruction(cp); op = cvp_next_instruction(cp);
op->dword = fixup.dword; *op = fixup;
} }
break; break;
@@ -1050,7 +1049,7 @@ static void cvp_emit_inst( struct compilation *cp,
if (result == REG_RES) { if (result == REG_RES) {
op = cvp_next_instruction(cp); op = cvp_next_instruction(cp);
op->dword = fixup.dword; *op = fixup;
} }
break; break;
} }
@@ -1074,7 +1073,7 @@ static void cvp_emit_inst( struct compilation *cp,
if (result == REG_RES) { if (result == REG_RES) {
op = cvp_next_instruction(cp); op = cvp_next_instruction(cp);
op->dword = fixup.dword; *op = fixup;
} }
break; break;
} }

View File

@@ -110,8 +110,6 @@ union instruction {
GLuint pad:7; GLuint pad:7;
GLuint pad2; GLuint pad2;
} msk; } msk;
MESA_LONGLONG dword;
}; };