1. mask-signed-field that casts an unsigned word into a fixnum is ir2-converted into a word-to-fixnum move
2. in cut-to-width, only cut a reference to a variable to width if the destination isn't an operation that cuts to width itself. This way, we avoid inserting m-s-f between m-s-f and a lambda var, or logand between logand and a lambda-var.
At first, I thought 2. might be subsumed by flattening chains of logand/m-s-f, but that doesn't seem likely (not that flattening wouldn't be a nice improvement).
I think the fix below works.
1. mask-signed-field that casts an unsigned word into a fixnum is ir2-converted into a word-to-fixnum move
2. in cut-to-width, only cut a reference to a variable to width if the destination isn't an operation that cuts to width itself. This way, we avoid inserting m-s-f between m-s-f and a lambda var, or logand between logand and a lambda-var.
At first, I thought 2. might be subsumed by flattening chains of logand/m-s-f, but that doesn't seem likely (not that flattening wouldn't be a nice improvement).