Page MenuHomePhabricator

[Clang][bmi][intrinsics] Adding _mm_tzcnt_64 _mm_tzcnt_32 intrinsics to clang.
ClosedPublic

Authored by m_zuckerman on Jun 15 2016, 5:13 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

m_zuckerman retitled this revision from to [Clang][bmi][intrinsics] Adding _mm_tzcnt_64 _mm_tzcnt_32 intrinsics to clang..
m_zuckerman updated this object.
m_zuckerman added reviewers: AsafBadouh, igorb, delena.
m_zuckerman added a subscriber: cfe-commits.
RKSimon added a subscriber: RKSimon.
RKSimon added inline comments.
lib/Headers/bmiintrin.h
296 ↗(On Diff #60821)

Why not just #define to __tzcnt_u32 like the (many) other duplicate tzcnt intrinsics we have:

#define _mm_tzcnt_32(a)     (__tzcnt_u32((a)))

Same for _mm_tzcnt_64

Also, please can you copy/paste/edit the doxygen comment so that its properly documented?

m_zuckerman added inline comments.Jun 21 2016, 4:20 AM
lib/Headers/bmiintrin.h
296 ↗(On Diff #61351)

We can't use #define Here. The mm_tzcnt_32(a) intrinsics is deferent from tzcnt_u32 in the return value. The mm_tzcnt_32 intrinsic return sign int while the tzcnt_u32 return unsign value.

RKSimon accepted this revision.Jun 21 2016, 8:06 AM
RKSimon edited edge metadata.

LGTM

lib/Headers/bmiintrin.h
284 ↗(On Diff #61351)

Why the newlines? It doesn't match the rest of the header.

296 ↗(On Diff #61351)

Ah! Missed that bit - thats fine.

This revision is now accepted and ready to land.Jun 21 2016, 8:06 AM
This revision was automatically updated to reflect the committed changes.