It looks like floor does a lot more, for example handling all the corner cases. Are you sure this isn't a problem here?
FWIW, just having the function inlined already helps a lot.
Btw, is there a reason you changed the switch/case identation? IMHO it makes reading the patch harder.