slavapestov/factor — Issue #392: Redundant tagging/untagging in codegen
Author: jckarter
Created: 2011-11-13 00:43:16+00:00
State: open
Labels: compiler

If you follow an `int-rep` insn with an `int-rep` insn, it doesn't clear out the intermediate tagging shifts. Example:

```factor
: wut ( x -- y ) { int-4 } declare 0 swap nth -4 fixnum-shift-fast ;
```

```text
\ wut disassemble

0x11507ee20: mov (%r14),%rax
0x11507ee23: mov 0x9(%rax),%rax
0x11507ee27: rex.W movdqa 0x7(%rax),%xmm0
0x11507ee2d: pextrd $0x0,%xmm0,%eax
0x11507ee33: movslq %eax,%rax
0x11507ee36: shl $0x4,%rax
0x11507ee3a: sar $0x8,%rax
0x11507ee3e: shl $0x4,%rax
0x11507ee42: mov %rax,(%r14)
0x11507ee45: mov %eax,-0xdabe4b(%rip) # 0x1142d3000
0x11507ee4b: retq
```