[PATCH] D140727: [XRay] Add initial support for loongarch64
    Fangrui Song via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Wed Jul  5 21:38:00 PDT 2023
    
    
  
MaskRay added inline comments.
================
Comment at: compiler-rt/lib/xray/xray_loongarch64.cpp:23
+enum PatchOpcodes : uint32_t {
+  PO_ADDID = 0x02c00000,  // addi.d rd, rj, imm
+  PO_SD = 0x29c00000,     // st.d rd, base, offset
----------------
I think the `PO_` style actually harms readability. Most instructions are used just once. It's more readable just using the magic number when it is needed paired with an inline comment
`Address[10] = insn2RI12(0x02c00000, RegNum::RN_S, ...) // addi.d ...`
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140727/new/
https://reviews.llvm.org/D140727
    
    
More information about the cfe-commits
mailing list