slavapestov/factor — Issue #391: Extra shift in fixnum-shift-fast codegen
Author: jckarter
Created: 2011-11-13 00:30:42+00:00
State: open
Labels: compiler

```factor
IN: scratchpad : wut ( x -- y ) -2 fixnum-shift-fast ;
IN: scratchpad \ wut disassemble
0000000115122110: 498b06 mov rax, [r14]
0000000115122113: 48c1f806 sar rax, 0x6
0000000115122117: 48c1e004 shl rax, 0x4
000000011512211b: 498906 mov [r14], rax
000000011512211e: 8905dc0e1bff mov [rip-0xe4f124], eax
0000000115122124: c3 ret
```

Looks like it shifts from tagged-rep to int-rep then converts back to tagged-rep. How hard would it be to get it to combine the operations?