Page MenuHomePhabricator

Lowering x86 adds/addus/subs/subus intrinsics (clang)
ClosedPublic

Authored by tkrupa on Mar 22 2018, 9:24 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

tkrupa created this revision.Mar 22 2018, 9:24 AM
craig.topper added inline comments.Mar 27 2018, 11:00 PM
lib/CodeGen/CGBuiltin.cpp
7897 ↗(On Diff #139456)

Can we just create the constant in the extended type?

7910 ↗(On Diff #139456)

ConstantInt::get should be able to splat on its own if you give it a vector type. Same with getAllOnesValue above

8922 ↗(On Diff #139456)

Substraction->Subtraction

8929 ↗(On Diff #139456)

Substraction->Subtraction

tkrupa marked 3 inline comments as done.Mar 29 2018, 7:19 AM
tkrupa added inline comments.
lib/CodeGen/CGBuiltin.cpp
7897 ↗(On Diff #139456)

We can't - SignedMaxValue is created in non-extended type and llvm::ConstantInt::get makes an assertion that the input is of the same type. We can perform sext() on SignedMaxValue but the result will be the same.

tkrupa updated this revision to Diff 140244.Mar 29 2018, 7:19 AM
craig.topper accepted this revision.Mar 29 2018, 9:44 AM

LGTM with that one comment.

lib/CodeGen/CGBuiltin.cpp
8288 ↗(On Diff #140244)

You could probably just do ResultType->getScalarSizeInBits() == 8

This revision is now accepted and ready to land.Mar 29 2018, 9:44 AM
tkrupa updated this revision to Diff 140401.Mar 30 2018, 3:11 AM
tkrupa marked an inline comment as done.
This revision was automatically updated to reflect the committed changes.