Opened 3 years ago

Last modified 3 months ago

#7337 new feature request

GHC does not generate great code for bit-level rotation

Reported by: bos Owned by:
Priority: normal Milestone: 8.0.1
Component: Compiler (NCG) Version: 7.6.1
Keywords: Cc: simonmar
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I'm working on some hashing functions at the moment, and I notice that GHC generates an or and a pair of shifts for a rotate. The LLVM back end is smart enough to recover the code's intent via strength reduction and emit a single rot instruction, but the regular code generator emits three instructions.

Change History (5)

comment:1 Changed 3 years ago by igloo

  • difficulty set to Unknown
  • Milestone set to 7.8.1

Thanks for the report.

comment:2 Changed 19 months ago by thoughtpolice

  • Milestone changed from 7.8.3 to 7.10.1

Moving to 7.10.1

comment:3 Changed 12 months ago by thomie

  • Cc simonmar added
  • Component changed from Compiler to Compiler (NCG)

comment:4 Changed 11 months ago by thoughtpolice

  • Milestone changed from 7.10.1 to 7.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:5 Changed 3 months ago by thoughtpolice

  • Milestone changed from 7.12.1 to 8.0.1

Milestone renamed

Note: See TracTickets for help on using tickets.