{"push_id":946931916,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"e16c334441efc004709f2c1f54e3d4abb08646e7","before":"2141d0845df47a4c527d0dbc75f6c894bdc3e1cc","commits":[{"sha":"e16c334441efc004709f2c1f54e3d4abb08646e7","author":{"email":"99f346658a335f564f87a5db55db57b4f8371bfa@apple.com","name":"fpizlo@apple.com"},"message":"B3 should strength-reduce division by a constant\nhttps://bugs.webkit.org/show_bug.cgi?id=153386\n\nReviewed by Benjamin Poulain.\n\nYou can turn a 32-bit division by a constant into a 64-bit multiplication by a constant\nplus some shifts. A book called \"Hacker's Delight\" has a bunch of math about this. The\nhard part is finding the constant by which to multiply, and the amount by which to shift.\nThe book tells you some theroems, but you still have to turn that into code by thinking\ndeep thoughts. Luckily I was able to avoid that because it turns out that LLVM already\nhas code for this. It's called APInt::magic(), where APInt is their class for reasoning\nabout integers.\n\nThe code has a compatible license to ours and we have already in the past taken code from\nLLVM. So, that's what this patch does. The LLVM code is localized in\nB3ComputeDivisionMagic.h. Then reduceStrength() uses that to construct the multiply+shift\nsequence.\n\nThis is an enormous speed-up on AsmBench-0.9/bigfib.cpp.js. It makes us as fast on that\ntest as LLVM. It reduces our deficit on AsmBench to 1.5%. Previously it was 4.5%.\n\n* JavaScriptCore.xcodeproj/project.pbxproj:\n* b3/B3ComputeDivisionMagic.h: Added.\n(JSC::B3::computeDivisionMagic):\n* b3/B3ReduceStrength.cpp:\n\n\n\ngit-svn-id: http://svn.webkit.org/repository/webkit/trunk@195503 268f45cc-cd09-0410-ab3c-d52691b4dbfc","distinct":true,"url":"https://api.github.com/repos/paul99/webkit-mips/commits/e16c334441efc004709f2c1f54e3d4abb08646e7"}]}