Use IntImmediateType for IMM encoding size calculation

This commit changes the logic for calculating the encoding size of IMM
to use IntImmediateType. This makes the logic more general and able to
handle both determinately sized and indeterminately sized IMMs.

Bug: 293811969
Test: TH
Change-Id: I6aac99f5511208e40358c6fe710fefe1cb61f546
1 file changed