Code: Select all
U8 U8x;
U16 U16x;
U32 U32x;
U64 U64x;
U8x = 3;
000000013F1C23C1 mov byte ptr [U8x],3
U16x = 7;
000000013F1C23C6 mov eax,7
000000013F1C23CB mov word ptr [U16x],ax
U32x = 15;
000000013F1C23D0 mov dword ptr [U32x],0Fh
U64x = 31;
000000013F1C23D8 mov qword ptr [U64x],1Fh
U8, U16... refer to unsigned integers with the corresponding number of bits.
I couldn't find the instruction times for each of the "xword ptr" instructions, but seeing how the assmebly code turned out makes me think that to represent data, one can/should use the smallest data size that is needed since it appears to be no difference to the machine, at least in the Intel world.
So, for example, consider the following structure:
Code: Select all
struct BOARD
{
U64 Bitboards[14];
U32 ChessBoard[64]; // serialized representation
U8 ChessBoard8[64]; // serialized representation
};
Is this assertion correct or are there hidden code gotcha that I haven't noticed?