[all-commits] [llvm/llvm-project] 7faf1a: [Sparc] Add errata workaround pass for GR712RC and...

Daniel Cederman via All-commits all-commits at lists.llvm.org
Sun Aug 18 23:00:19 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7faf1a0868cb6a6a05e454044239292c454e0a71
      https://github.com/llvm/llvm-project/commit/7faf1a0868cb6a6a05e454044239292c454e0a71
  Author: Daniel Cederman <cederman at gaisler.com>
  Date:   2024-08-19 (Mon, 19 Aug 2024)

  Changed paths:
    M llvm/lib/Target/Sparc/DelaySlotFiller.cpp
    M llvm/lib/Target/Sparc/LeonFeatures.td
    M llvm/lib/Target/Sparc/LeonPasses.cpp
    M llvm/lib/Target/Sparc/LeonPasses.h
    M llvm/lib/Target/Sparc/Sparc.h
    M llvm/lib/Target/Sparc/SparcAsmPrinter.cpp
    M llvm/lib/Target/Sparc/SparcTargetMachine.cpp
    A llvm/test/CodeGen/SPARC/tn0009.mir
    A llvm/test/CodeGen/SPARC/tn0010.mir
    A llvm/test/CodeGen/SPARC/tn0011.ll
    A llvm/test/CodeGen/SPARC/tn0012.mir
    A llvm/test/CodeGen/SPARC/tn0013.mir

  Log Message:
  -----------
  [Sparc] Add errata workaround pass for GR712RC and UT700 (#103843)

This patch adds a pass that provides workarounds for the errata
described in GRLIB-TN-0009, GRLIB-TN-0010, GRLIB-TN-0011, GRLIB-TN-0012,
and GRLIB-TN-0013, that are applicable to the GR712RC and UT700. The
documents are available for download from here:

https://www.gaisler.com/index.php/information/app-tech-notes

The pass will detect certain sensitive instruction sequences and prevent
them from occurring by inserting NOP instruction. Below is an overview
of each of the workarounds. A similar implementation is available in
GCC.

GRLIB-TN-0009:

* Insert NOPs to prevent the sequence (stb/sth/st/stf) -> (single
non-store/load instruction) -> (any store)

* Insert NOPs to prevent the sequence (std/stdf) -> (any store)

GRLIB-TN-0010:

* Insert a NOP between load instruction and atomic instruction (swap and
casa).

* Insert a NOP at branch target if load in delay slot and atomic
instruction at branch target.

* Do not allow functions to begin with atomic instruction.

GRLIB-TN-0011:

* Insert .p2align 4 before atomic instructions (swap and casa).

GRLIB-TN-0012:

* Place a NOP at the branch target of an integer branch if it is a
floating-point operation or a floating-point branch.

GRLIB-TN-0013:

* Prevent (div/sqrt) instructions in the delay slot.

* Insert NOPs to prevent the sequence (div/sqrt) -> (two or three
floating point operations or loads) -> (div/sqrt).

* Do not insert NOPs if any of the floating point operations have a
dependency on the destination register of the first (div/sqrt).

* Do not insert NOPs if one of the floating point operations is a
(div/sqrt).

* Insert NOPs to prevent (div/sqrt) followed by a branch.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list