Auto merge of #11458 - kevgs:log2, r=Manishearth
Auto merge of #11458 - kevgs:log2, r=Manishearth

add log2(u32) and use it to prevent casting to and from float to int

<!-- Please describe your changes on the following line: -->
PR for #11440
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11458)
<!-- Reviewable:end -->

peterjoel/servo,jimberlage/servo,larsbergstrom/servo,larsbergstrom/servo,thiagopnts/servo,KiChjang/servo,thiagopnts/servo,rnestler/servo,larsbergstrom/servo,emilio/servo,saneyuki/servo,thiagopnts/servo,KiChjang/servo,nrc/servo,rnestler/servo,anthgur/servo,DominoTree/servo,sadmansk/servo,saneyuki/servo,KiChjang/servo,peterjoel/servo,upsuper/servo,nnethercote/servo,ConnorGBrewster/servo,eddyb/servo,cbrewster/servo,avadacatavra/servo,upsuper/servo,szeged/servo,DominoTree/servo,saneyuki/servo,ConnorGBrewster/servo,dati91/servo,upsuper/servo,pyfisch/servo,DominoTree/servo,notriddle/servo,emilio/servo,mbrubeck/servo,nrc/servo,nnethercote/servo,avadacatavra/servo,emilio/servo,sadmansk/servo,dsandeephegde/servo,mbrubeck/servo,peterjoel/servo,upsuper/servo,fiji-flo/servo,emilio/servo,anthgur/servo,canaltinova/servo,pyfisch/servo,saneyuki/servo,dsandeephegde/servo,splav/servo,nrc/servo,CJ8664/servo,dati91/servo,jimberlage/servo,thiagopnts/servo,CJ8664/servo,fiji-flo/servo,peterjoel/servo,nrc/servo,nnethercote/servo,dsandeephegde/servo,SimonSapin/servo,rnestler/servo,peterjoel/servo,mattnenterprise/servo,dati91/servo,canaltinova/servo,cbrewster/servo,saneyuki/servo,mbrubeck/servo,notriddle/servo,CJ8664/servo,DominoTree/servo,avadacatavra/servo,eddyb/servo,nnethercote/servo,dsandeephegde/servo,sadmansk/servo,CJ8664/servo,paulrouget/servo,eddyb/servo,sadmansk/servo,pyfisch/servo,mbrubeck/servo,dsandeephegde/servo,larsbergstrom/servo,paulrouget/servo,cbrewster/servo,eddyb/servo,fiji-flo/servo,mbrubeck/servo,SimonSapin/servo,ConnorGBrewster/servo,szeged/servo,szeged/servo,DominoTree/servo,cbrewster/servo,eddyb/servo,nnethercote/servo,saneyuki/servo,jimberlage/servo,cbrewster/servo,mattnenterprise/servo,cbrewster/servo,anthgur/servo,szeged/servo,notriddle/servo,fiji-flo/servo,DominoTree/servo,eddyb/servo,KiChjang/servo,notriddle/servo,upsuper/servo,mattnenterprise/servo,larsbergstrom/servo,dati91/servo,canaltinova/servo,szeged/servo,jimberlage/servo,nnethercote/servo,paulrouget/servo,splav/servo,notriddle/servo,notriddle/servo,nrc/servo,KiChjang/servo,ConnorGBrewster/servo,anthgur/servo,DominoTree/servo,notriddle/servo,mattnenterprise/servo,saneyuki/servo,rnestler/servo,CJ8664/servo,pyfisch/servo,paulrouget/servo,avadacatavra/servo,splav/servo,szeged/servo,thiagopnts/servo,nnethercote/servo,ConnorGBrewster/servo,notriddle/servo,eddyb/servo,cbrewster/servo,avadacatavra/servo,splav/servo,KiChjang/servo,pyfisch/servo,mbrubeck/servo,dsandeephegde/servo,sadmansk/servo,pyfisch/servo,splav/servo,upsuper/servo,peterjoel/servo,SimonSapin/servo,nnethercote/servo,saneyuki/servo,peterjoel/servo,paulrouget/servo,saneyuki/servo,larsbergstrom/servo,SimonSapin/servo,nnethercote/servo,splav/servo,rnestler/servo,pyfisch/servo,mbrubeck/servo,fiji-flo/servo,nrc/servo,emilio/servo,thiagopnts/servo,jimberlage/servo,anthgur/servo,paulrouget/servo,dati91/servo,fiji-flo/servo,sadmansk/servo,jimberlage/servo,upsuper/servo,SimonSapin/servo,nnethercote/servo,mattnenterprise/servo,dati91/servo,rnestler/servo,thiagopnts/servo,avadacatavra/servo,SimonSapin/servo,larsbergstrom/servo,szeged/servo,dsandeephegde/servo,paulrouget/servo,KiChjang/servo,eddyb/servo,paulrouget/servo,peterjoel/servo,ConnorGBrewster/servo,CJ8664/servo,DominoTree/servo,pyfisch/servo,avadacatavra/servo,canaltinova/servo,splav/servo,mattnenterprise/servo,anthgur/servo,splav/servo,saneyuki/servo,thiagopnts/servo,emilio/servo,canaltinova/servo,larsbergstrom/servo,KiChjang/servo,emilio/servo,cbrewster/servo,CJ8664/servo,mbrubeck/servo,paulrouget/servo,sadmansk/servo,splav/servo,emilio/servo,fiji-flo/servo,dati91/servo,rnestler/servo,ConnorGBrewster/servo,szeged/servo,mattnenterprise/servo,paulrouget/servo,pyfisch/servo,DominoTree/servo,avadacatavra/servo,anthgur/servo,mattnenterprise/servo,jimberlage/servo,SimonSapin/servo,szeged/servo,fiji-flo/servo,canaltinova/servo,larsbergstrom/servo,larsbergstrom/servo,emilio/servo,sadmansk/servo,SimonSapin/servo,peterjoel/servo,CJ8664/servo,ConnorGBrewster/servo,peterjoel/servo,upsuper/servo,KiChjang/servo,KiChjang/servo,pyfisch/servo,splav/servo,jimberlage/servo,nrc/servo,szeged/servo,jimberlage/servo,notriddle/servo,canaltinova/servo,canaltinova/servo,DominoTree/servo,emilio/servo,dati91/servo,anthgur/servo,notriddle/servo,rnestler/servo,dsandeephegde/servo