Skip to content

Commit

Permalink
[RISCV] Use !cond instead of multiple !if in RISCVInstrInfoVPseudos.t…
Browse files Browse the repository at this point in the history
…d. NFC

Rely on !cond erroring for unmatched condition instead of using a
bogus string for the default.
  • Loading branch information
topperc committed Feb 15, 2023
1 parent d464edd commit 052ae28
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,13 @@ class log2<int num> {
}

class octuple_to_str<int octuple> {
string ret = !if(!eq(octuple, 1), "MF8",
!if(!eq(octuple, 2), "MF4",
!if(!eq(octuple, 4), "MF2",
!if(!eq(octuple, 8), "M1",
!if(!eq(octuple, 16), "M2",
!if(!eq(octuple, 32), "M4",
!if(!eq(octuple, 64), "M8",
"NoDef")))))));
string ret = !cond(!eq(octuple, 1): "MF8",
!eq(octuple, 2): "MF4",
!eq(octuple, 4): "MF2",
!eq(octuple, 8): "M1",
!eq(octuple, 16): "M2",
!eq(octuple, 32): "M4",
!eq(octuple, 64): "M8");
}

def VLOpFrag : PatFrag<(ops), (XLenVT (VLOp (XLenVT AVL:$vl)))>;
Expand Down

0 comments on commit 052ae28

Please sign in to comment.