1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/test/TableGen
Michael Liao 086020d2e5 Re-work bit/bits value resolving in tblgen
- This patch is inspired by the failure of the following code snippet
  which is used to convert enumerable values into encoding bits to
  improve the readability of td files.

  class S<int s> {
    bits<2> V = !if(!eq(s, 8),  {0, 0},
                !if(!eq(s, 16), {0, 1},
                !if(!eq(s, 32), {1, 0},
                !if(!eq(s, 64), {1, 1}, {?, ?}))));
  }

  Later, PR8330 is found to report not exactly the same bug relevant
  issue to bit/bits values.

- Instead of resolving bit/bits values separately through
  resolveBitReference(), this patch adds getBit() for all Inits and
  resolves bit value by resolving plus getting the specified bit. This
  unifies the resolving of bit with other values and removes redundant
  logic for resolving bit only. In addition,
  BitsInit::resolveReferences() is optimized to take advantage of this
  origanization by resolving VarBitInit's variable reference first and
  then getting bits from it.

- The type interference in '!if' operator is revised to support possible
  combinations of int and bits/bit in MHS and RHS.

- As there may be illegal assignments from integer value to bit, says
  assign 2 to a bit, but we only check this during instantiation in some
  cases, e.g.

  bit V = !if(!eq(x, 17), 0, 2);

  Verbose diagnostic message is generated when invalid value is
  resolveed to help locating the error.

- PR8330 is fixed as well.

llvm-svn: 163360
2012-09-06 23:32:48 +00:00
..
2003-08-03-PassCode.td
2006-09-18-LargeInt.td
2010-03-24-PrematureDefaults.td
AnonDefinitionOnDemand.td
BitsInitOverflow.td
cast.td Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
CStyleComment.td
Dag.td
defmclass.td
DefmInherit.td Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
DefmInsideMultiClass.td
eq.td
eqbit.td
FieldAccess.td
foreach.td Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
ForeachList.td
ForeachLoop.td Add support for range expressions in TableGen foreach loops. 2012-05-24 22:17:39 +00:00
ForwardRef.td
GeneralList.td
if.td Re-work bit/bits value resolving in tblgen 2012-09-06 23:32:48 +00:00
ifbit.td
Include.inc
Include.td
IntBitInit.td
LazyChange.td Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
LetInsideMultiClasses.td
lisp.td Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
list-element-bitref.td Re-work bit/bits value resolving in tblgen 2012-09-06 23:32:48 +00:00
ListArgs.td
ListArgsSimple.td
ListConversion.td
ListManip.td
ListOfList.td Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
ListSlices.td
lit.local.cfg
LoLoL.td
MultiClass.td Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
MultiClassDefName.td
MultiClassInherit.td Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
MultiPat.td
nested-comment.td
NestedForeach.td
Paste.td
pr8330.td Re-work bit/bits value resolving in tblgen 2012-09-06 23:32:48 +00:00
SetTheory.td
SiblingForeach.td
Slice.td Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
strconcat.td
String.td
subst2.td
subst.td Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
SuperSubclassSameName.td
TargetInstrInfo.td
TargetInstrSpec.td Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
TemplateArgRename.td
Tree.td
TreeNames.td
TwoLevelName.td
UnsetBitInit.td
UnterminatedComment.td
usevalname.td