This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Add the !not and !xor operators.
ClosedPublic

Authored by Paul-C-Anagnostopoulos on Oct 13 2020, 10:23 AM.

Details

Summary

This patch adds two new bang operators. !not produces the logical not of its argument. Using this clarifies code such as

!if(!eq(bool, 0), ...  --versus--  !if(!not(bool), ...

The !xor operator completes the usual complement of three bitwise operators.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2020, 10:23 AM
Paul-C-Anagnostopoulos requested review of this revision.Oct 13 2020, 10:23 AM
lattner accepted this revision.Oct 13 2020, 11:15 AM

Makes sense to me. Please do follow-on patches to adopt this in the various users of tblgen. Thanks!

This revision is now accepted and ready to land.Oct 13 2020, 11:15 AM

I will look through the various TableGen files and use these where appropriate.

Before I push this, I have to update the TableGen Programmer's Reference.

I update the TableGen Programmer's Reference to document the two new bang operators.

nhaehnle accepted this revision.Oct 14 2020, 4:14 PM

This patch has been pushed.