[PATCH] D151023: [llvm-exegesis] Add Target Memory Utility Functions

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 03:57:07 PDT 2023


courbet accepted this revision.
courbet added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/tools/llvm-exegesis/lib/X86/Target.cpp:994-1001
+  GeneratedCode.push_back(MCInstBuilder(X86::SHR64ri)
+                              .addReg(Register)
+                              .addReg(Register)
+                              .addImm(PageSizeBits));
+  GeneratedCode.push_back(MCInstBuilder(X86::SHL64ri)
+                              .addReg(Register)
+                              .addReg(Register)
----------------
aidengrossman wrote:
> courbet wrote:
> > Another, maybe simpler option is: `AND64ri register, -page_size`
> I find the shift left/right pattern to be a little bit more intuitive since using an `AND` instruction involves understanding a bitwise "trick" when reading, but it definitely is shorter. I don't have any particularly strong feelings on this though, so if you want me to change it, just let me know.
> I find the shift left/right pattern to be a little bit more intuitive since using an `AND` instruction involves understanding a bitwise "trick" when reading, but it definitely is shorter. I don't have any particularly strong feelings on this though, so if you want me to change it, just let me know.

No strong opinion, you can keep it as it if you want.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151023/new/

https://reviews.llvm.org/D151023



More information about the llvm-commits mailing list