This is an archive of the discontinued LLVM Phabricator instance.

Add tablegen definition for the Find Leading Set (FLS) instruction for the ARC backend
ClosedPublic

Authored by thomasjohns on Jul 22 2021, 2:52 PM.

Details

Summary

This adds an entry for the FLS instruction to tablegen and demonstrates the ability to decode this instruction from an object file.

For example, when disassembling the object file derived from compiling:

int f(int x) {
  return __builtin_clz(x);
}

we used to have:

00000000 <f>:
       0: 2f 28 13 80   <unknown>
       4: ca 20 21 08   mov.eq  %r0, 32
       8: e0 7f         j_s.d   [%blink]
       a: ce 20 e2 07   rsub.ne %r0, %r0, 31

but now we have:

00000000 <f>:
       0: 2f 28 13 80   fls.f   %r0, %r0
       4: ca 20 21 08   mov.eq  %r0, 32
       8: e0 7f         j_s.d   [%blink]
       a: ce 20 e2 07   rsub.ne %r0, %r0, 31

Diff Detail

Event Timeline

thomasjohns created this revision.Jul 22 2021, 2:52 PM
thomasjohns requested review of this revision.Jul 22 2021, 2:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2021, 2:52 PM
marksl accepted this revision.Jul 22 2021, 3:23 PM

Your changes look good to me

This revision is now accepted and ready to land.Jul 22 2021, 3:23 PM
This revision was landed with ongoing or failed builds.Jul 22 2021, 5:45 PM
This revision was automatically updated to reflect the committed changes.