(0.9.37-unstable) Backport changes to cpu.cpp