LlvmCodeGen: add support for MO_U_Mul2 CallishMachOp
ClosedPublic

Authored by michalt on Jul 14 2015, 1:34 PM.

Details

Summary

This adds support MO_U_Mul2 to the LLVM backend by simply using 'mul'
instruction but operating at twice the bit width (e.g., for 64 bit
words we will generate mul that operates on 128 bits and then extract
the two 64 bit values for the result of the CallishMachOp).

Test Plan

validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
michalt updated this revision to Diff 3544.Jul 14 2015, 1:34 PM
michalt retitled this revision from to LlvmCodeGen: add support for MO_U_Mul2 CallishMachOp.
michalt updated this object.
michalt edited the test plan for this revision. (Show Details)
michalt added reviewers: bgamari, rwbarton.
michalt updated the Trac tickets for this revision.
michalt updated this revision to Diff 3545.Jul 14 2015, 1:35 PM
michalt edited edge metadata.

More consistent formatting of the test

bgamari accepted this revision.Jul 17 2015, 1:12 PM
bgamari edited edge metadata.

Awesome! This looks great.

This revision is now accepted and ready to land.Jul 17 2015, 1:12 PM
This revision was automatically updated to reflect the committed changes.
rwbarton edited edge metadata.Jul 20 2015, 11:28 PM

Cool, and LLVM can turn all this into a single-operand imul instruction on x86_64 I hope?

Cool, and LLVM can turn all this into a single-operand imul instruction on x86_64 I hope?

I've just checked that it generates a single mulq instruction :-)
(I'm guessing that's what you meant since this is unsigned multiplication)