This is an archive of the discontinued LLVM Phabricator instance.

Implement __emul, __emulu, _mul128 and _umul128 MS intrinsics
ClosedPublic

Authored by agutowski on Oct 6 2016, 6:13 PM.

Event Timeline

agutowski updated this revision to Diff 73872.Oct 6 2016, 6:13 PM
agutowski retitled this revision from to Implement __emul, __emulu, _mul128 and _umul128 MS intrinsics.
agutowski updated this object.
agutowski added reviewers: hans, rnk, thakis, majnemer.
agutowski added a subscriber: cfe-commits.
hans accepted this revision.Oct 10 2016, 1:39 AM
hans edited edge metadata.

lgtm with some nits

lib/CodeGen/CGBuiltin.cpp
7592

While you're here, or if you want to do a follow-up, I think this code could just use Ops[0] and Ops[1] directly, as the "EmitScaleExpr" was done earlier.

lib/Headers/intrin.h
420

Maybe move this one next to __mul128 (or move that here), so they're next to each other in the file.

test/CodeGen/ms-x86-intrinsics.c
57

it would be good to check for the sext's too (and zext's for _umul128)

This revision is now accepted and ready to land.Oct 10 2016, 1:39 AM
agutowski updated this revision to Diff 74147.Oct 10 2016, 11:02 AM
agutowski edited edge metadata.

address comments

Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in rL283785.