This is an archive of the discontinued LLVM Phabricator instance.

Clzero flag addition and inclusion under znver1
ClosedPublic

Authored by GGanesh on Feb 1 2017, 2:42 AM.

Details

Summary
  1. Adds the command line flag for clzero.
  2. Includes the clzero flag under znver1.
  3. Defines the macro for clzero.
  4. Adds a new file which has the intrinsic definition for clzero instruction.

https://reviews.llvm.org/D29385

Diff Detail

Repository
rL LLVM

Event Timeline

GGanesh created this revision.Feb 1 2017, 2:42 AM
RKSimon edited edge metadata.Feb 1 2017, 4:12 AM

Please add a test for __builtin_ia32_clzero to llvm\tools\clang\test\CodeGen\builtins-x86.c

lib/Headers/clzerointrin.h
53 ↗(On Diff #86601)

Why the extra copyright header - this wasn't added to previous AMD only instructions

65 ↗(On Diff #86601)

Would it be possible to add a doxygen description? See some of the other x86 headers for examples.

GGanesh updated this revision to Diff 87386.Feb 7 2017, 2:46 AM

Updated for review comments.

Still missing a test in llvm\tools\clang\test\CodeGen\builtins-x86.c

GGanesh updated this revision to Diff 87437.Feb 7 2017, 7:54 AM

Updated the builtins test for "__builtin_ia32_clzero"

craig.topper accepted this revision.Feb 8 2017, 8:47 PM

LGTM, but i'll make some additional testing changes before committing it.

-Add CLZERO checks to test/Preprocessor/predefined-arch-macros.c for znver1
-Add command line testing to test/Driver/x86-target-features.c
-Add a test to verify the generated IR.

This revision is now accepted and ready to land.Feb 8 2017, 8:47 PM
GGanesh added a comment.EditedFeb 8 2017, 9:58 PM

Thank you @craig.topper.

Just want to check if the patch can be commited to 4.0 release branch as well.
I understand that the branch is in blocker bug-fix stage but just want to get it confirmed.

This revision was automatically updated to reflect the committed changes.