[PATCH] D21960: [Sparc] Leon errata fixes passes.

Daniel Cederman via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 04:14:15 PDT 2016


dcederman added a comment.

I noticed that some of the files have been marked as executable. You should change that before committing anything.


================
Comment at: lib/Target/Sparc/LeonPasses.cpp:757-762
@@ +756,8 @@
+//
+// mov 0, %l0
+// mov 4096, %l1
+// loop1:
+// inc %l0
+// cmp %l0, %l1
+// ble loop1
+
----------------
How does this fill the data cache?

================
Comment at: lib/Target/Sparc/LeonPasses.cpp:851-859
@@ +850,11 @@
+//****************************************************************************************************************
+// This erratum fix should handle user traps of FPU exceptions and restore the
+// execution address by skipping the trapped FPU instruction.
+// The algorithm:
+// find rett - return from trap
+// insert code before rett to:
+// 1. load the FSR register
+// 2. check if there is an FPU exception
+// 3. branch to old rett if there is no exception
+// 4. rett to a restored exec address
+char RestoreExecAddress::ID = 0;
----------------
Erratas in trap handling should not be handled by the compiler, it should be done manually in each OS. Did you try to compile the trap handling code in, for example, Linux or RTEMS with this fix?

================
Comment at: lib/Target/Sparc/LeonPasses.h:107-109
@@ +106,5 @@
+
+  const char *getPassName() const override {
+    return "FillDataCache: Erratum Fix LBR29: fill data cache with values at application startup";
+  }
+};
----------------
What is LBR29? Please add a description of the errata and the fix or a reference to an official document with the information.

What do you mean by application startup?


Repository:
  rL LLVM

https://reviews.llvm.org/D21960





More information about the llvm-commits mailing list