Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1 | From: Chris Lattner [mailto:sabre@nondot.org] |
| 2 | Sent: Wednesday, December 06, 2000 6:41 PM |
| 3 | To: Vikram S. Adve |
| 4 | Subject: Additional idea with respect to encoding |
| 5 | |
| 6 | Here's another idea with respect to keeping the common case instruction |
| 7 | size down (less than 32 bits ideally): |
| 8 | |
| 9 | Instead of encoding an instruction to operate on two register numbers, |
| 10 | have it operate on two negative offsets based on the current register |
| 11 | number. Therefore, instead of using: |
| 12 | |
| 13 | r57 = add r55, r56 (r57 is the implicit dest register, of course) |
| 14 | |
| 15 | We could use: |
| 16 | |
| 17 | r57 = add -2, -1 |
| 18 | |
| 19 | My guess is that most SSA references are to recent values (especially if |
| 20 | they correspond to expressions like (x+y*z+p*q/ ...), so the negative |
| 21 | numbers would tend to stay small, even at the end of the procedure (where |
| 22 | the implicit register destination number could be quite large). Of course |
| 23 | the negative sign is reduntant, so you would be storing small integers |
| 24 | almost all of the time, and 5-6 bits worth of register number would be |
| 25 | plenty for most cases... |
| 26 | |
| 27 | What do you think? |
| 28 | |
| 29 | -Chris |
| 30 | |