[PATCH] D67705: [mips] Expand 'lw/sw' instructions for 32-bit GOT

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 11:49:38 PDT 2019


atanasyan marked 2 inline comments as done.
atanasyan added inline comments.


================
Comment at: llvm/test/MC/Mips/mips64-expansions.s:3
 # RUN:            -show-encoding | FileCheck --check-prefixes=CHECK,GOT %s
 
 # Check that signed negative 32-bit immediates are loaded correctly:
----------------
Petar.Avramovic wrote:
> Missing run line with -mattr=+xgot.
Good catch. I'll fix that.


================
Comment at: llvm/test/MC/Mips/mips64-expansions.s:506
+
+# XGOT:      ld     $8, %got_disp(sym)($gp)     # encoding: [A,A,0x88,0xdf]
+# XGOT-NEXT:                                    #   fixup A - offset: 0, value: %got_disp(sym), kind: fixup_Mips_GOT_DISP
----------------
Petar.Avramovic wrote:
> Do symbols have different handling in assembly file based on something, like getAddrLocal and getAddrGlobal/getAddrGlobalLargeGOT in MipsISelLowering.cpp ?
> 
Yes. The `xgot` flag does not affect taking address of local symbol. For global symbols with `xgot` flag we generate a pair of `%got_hi/%got_lo` relocations like the `getAddrGlobalLargeGOT` does. Without `xgot` flag we generate `%got_disp` in 64-bit case and `%got` in 32-bit case like the `getAddrGlobal` does.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67705





More information about the llvm-commits mailing list