[all-commits] [llvm/llvm-project] d93f85: [TableGen] Extend OPC_ExtractField/OPC_CheckField ...

Jason Eckhardt via All-commits all-commits at lists.llvm.org
Mon Jan 29 06:22:34 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d93f850c6f11aa315c83a34ec59210e1755528f8
      https://github.com/llvm/llvm-project/commit/d93f850c6f11aa315c83a34ec59210e1755528f8
  Author: Jason Eckhardt <jason.eckhardt at solana.com>
  Date:   2024-01-29 (Mon, 29 Jan 2024)

  Changed paths:
    M llvm/include/llvm/MC/MCDecoderOps.h
    A llvm/test/TableGen/trydecode-emission4.td
    M llvm/utils/TableGen/DecoderEmitter.cpp

  Log Message:
  -----------
  [TableGen] Extend OPC_ExtractField/OPC_CheckField start value widths. (#79723)

Both OPC_ExtractField and OPC_CheckField are currently defined to take
an unsigned 8-bit start value. On some architectures with long
instruction words, this value can silently overflow, resulting in a bad
decoder table.

This patch changes each to take a ULE128B-encoded start value instead.
Additionally, a range assertion is added for the 8-bit length to
prominently notify a user in case that field ever overflows.

This problem isn't currently exposed upstream since all in-tree targets
use small instruction words (i.e., bitwidth <= 64 bits). It does show up
in at least one downstream target with instructions > 64 bits long.

Co-authored-by: Jason Eckhardt <jeckhardt at nvidia.com>




More information about the All-commits mailing list