I believe he meant adding as in appending, due to the shift left two bit above.
int8_t read_encoder()
{
static int8_t enc_states[] = {0,-1,1,0,1,0,0,-1,-1,0,0,1,0,1,-1,0};
static uint8_t old_AB = 0;
/**/
old_AB <<= 2; //remember previous state
old_AB |= ( ENC_PORT & 0x03 ); //add current state
return ( enc_states[( old_AB & 0x0f )]);
}
So you start with 0, then it shifts two bits to the left from the previous read, then appends (adds) A0 & A1 into it.
So Andy is right but I would put a couple more parenthesis just in case:
old_AB |= ((ENC_PORT & 0x06) >> 1); // This will read A1 & A2 and move them one bit right so old_AB will end up with the needed index to enc_states.