some architecture changes to support texturelength_s and texturelength_t