Avoid some unneccesary instructions in swapValues

If source and target values are of the same type, there's no need
to write the type to the stack once again.

Change-Id: I3e1600407012f7bd7f2e5ba91b279b0421be9e68
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Really eliminate a|0 and b&(-1)

The old code wasn't doing what it promised to do
and failed to remove these expressions.

Change-Id: I6718539fd528f293db537e47ff1c9ac4b27ada55
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>