1*9880d681SAndroid Build Coastguard WorkerFrom: Chris Lattner [mailto:[email protected]] 2*9880d681SAndroid Build Coastguard WorkerSent: Wednesday, December 06, 2000 6:41 PM 3*9880d681SAndroid Build Coastguard WorkerTo: Vikram S. Adve 4*9880d681SAndroid Build Coastguard WorkerSubject: Additional idea with respect to encoding 5*9880d681SAndroid Build Coastguard Worker 6*9880d681SAndroid Build Coastguard WorkerHere's another idea with respect to keeping the common case instruction 7*9880d681SAndroid Build Coastguard Workersize down (less than 32 bits ideally): 8*9880d681SAndroid Build Coastguard Worker 9*9880d681SAndroid Build Coastguard WorkerInstead of encoding an instruction to operate on two register numbers, 10*9880d681SAndroid Build Coastguard Workerhave it operate on two negative offsets based on the current register 11*9880d681SAndroid Build Coastguard Workernumber. Therefore, instead of using: 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard Workerr57 = add r55, r56 (r57 is the implicit dest register, of course) 14*9880d681SAndroid Build Coastguard Worker 15*9880d681SAndroid Build Coastguard WorkerWe could use: 16*9880d681SAndroid Build Coastguard Worker 17*9880d681SAndroid Build Coastguard Workerr57 = add -2, -1 18*9880d681SAndroid Build Coastguard Worker 19*9880d681SAndroid Build Coastguard WorkerMy guess is that most SSA references are to recent values (especially if 20*9880d681SAndroid Build Coastguard Workerthey correspond to expressions like (x+y*z+p*q/ ...), so the negative 21*9880d681SAndroid Build Coastguard Workernumbers would tend to stay small, even at the end of the procedure (where 22*9880d681SAndroid Build Coastguard Workerthe implicit register destination number could be quite large). Of course 23*9880d681SAndroid Build Coastguard Workerthe negative sign is reduntant, so you would be storing small integers 24*9880d681SAndroid Build Coastguard Workeralmost all of the time, and 5-6 bits worth of register number would be 25*9880d681SAndroid Build Coastguard Workerplenty for most cases... 26*9880d681SAndroid Build Coastguard Worker 27*9880d681SAndroid Build Coastguard WorkerWhat do you think? 28*9880d681SAndroid Build Coastguard Worker 29*9880d681SAndroid Build Coastguard Worker-Chris 30*9880d681SAndroid Build Coastguard Worker 31