2013-04-14 03:02:23 +08:00
|
|
|
; RUN: llc < %s -march=sparc -relocation-model=static -code-model=small | FileCheck --check-prefix=abs32 %s
|
|
|
|
; RUN: llc < %s -march=sparcv9 -relocation-model=static -code-model=small | FileCheck --check-prefix=abs32 %s
|
2013-04-14 12:57:51 +08:00
|
|
|
; RUN: llc < %s -march=sparcv9 -relocation-model=static -code-model=medium | FileCheck --check-prefix=abs44 %s
|
2013-04-14 13:10:36 +08:00
|
|
|
; RUN: llc < %s -march=sparcv9 -relocation-model=static -code-model=large | FileCheck --check-prefix=abs64 %s
|
2013-04-14 03:02:23 +08:00
|
|
|
; RUN: llc < %s -march=sparc -relocation-model=pic -code-model=medium | FileCheck --check-prefix=v8pic32 %s
|
2013-04-14 09:53:23 +08:00
|
|
|
; RUN: llc < %s -march=sparcv9 -relocation-model=pic -code-model=medium | FileCheck --check-prefix=v9pic32 %s
|
2013-04-14 03:02:23 +08:00
|
|
|
|
|
|
|
@G = external global i8
|
|
|
|
|
|
|
|
define zeroext i8 @loadG() {
|
|
|
|
%tmp = load i8* @G
|
|
|
|
ret i8 %tmp
|
|
|
|
}
|
|
|
|
|
|
|
|
; abs32: loadG
|
|
|
|
; abs32: sethi %hi(G), %[[R:[gilo][0-7]]]
|
2014-01-10 10:55:27 +08:00
|
|
|
; abs32: retl
|
2013-06-02 10:24:27 +08:00
|
|
|
; abs32: ldub [%[[R]]+%lo(G)], %o0
|
|
|
|
|
2013-04-14 03:02:23 +08:00
|
|
|
|
2013-04-14 12:57:51 +08:00
|
|
|
; abs44: loadG
|
|
|
|
; abs44: sethi %h44(G), %[[R1:[gilo][0-7]]]
|
|
|
|
; abs44: add %[[R1]], %m44(G), %[[R2:[gilo][0-7]]]
|
|
|
|
; abs44: sllx %[[R2]], 12, %[[R3:[gilo][0-7]]]
|
2014-01-10 10:55:27 +08:00
|
|
|
; abs44: retl
|
2013-06-02 10:24:27 +08:00
|
|
|
; abs44: ldub [%[[R3]]+%l44(G)], %o0
|
|
|
|
|
2013-04-14 12:57:51 +08:00
|
|
|
|
2013-04-14 13:10:36 +08:00
|
|
|
; abs64: loadG
|
|
|
|
; abs64: sethi %hi(G), %[[R1:[gilo][0-7]]]
|
|
|
|
; abs64: add %[[R1]], %lo(G), %[[R2:[gilo][0-7]]]
|
|
|
|
; abs64: sethi %hh(G), %[[R3:[gilo][0-7]]]
|
|
|
|
; abs64: add %[[R3]], %hm(G), %[[R4:[gilo][0-7]]]
|
|
|
|
; abs64: sllx %[[R4]], 32, %[[R5:[gilo][0-7]]]
|
2014-01-10 10:55:27 +08:00
|
|
|
; abs64: retl
|
2013-06-02 10:24:27 +08:00
|
|
|
; abs64: ldub [%[[R5]]+%[[R2]]], %o0
|
|
|
|
|
2013-04-14 13:10:36 +08:00
|
|
|
|
2013-04-14 03:02:23 +08:00
|
|
|
; v8pic32: loadG
|
|
|
|
; v8pic32: _GLOBAL_OFFSET_TABLE_
|
|
|
|
; v8pic32: sethi %hi(G), %[[R1:[gilo][0-7]]]
|
|
|
|
; v8pic32: add %[[R1]], %lo(G), %[[Goffs:[gilo][0-7]]]
|
|
|
|
; v8pic32: ld [%[[GOT:[gilo][0-7]]]+%[[Goffs]]], %[[Gaddr:[gilo][0-7]]]
|
2013-09-22 09:40:24 +08:00
|
|
|
; v8pic32: ldub [%[[Gaddr]]], %i0
|
2014-01-10 10:55:27 +08:00
|
|
|
; v8pic32: ret
|
2013-09-22 09:40:24 +08:00
|
|
|
; v8pic32: restore
|
2013-06-02 10:24:27 +08:00
|
|
|
|
2013-04-14 09:53:23 +08:00
|
|
|
|
|
|
|
; v9pic32: loadG
|
|
|
|
; v9pic32: _GLOBAL_OFFSET_TABLE_
|
|
|
|
; v9pic32: sethi %hi(G), %[[R1:[gilo][0-7]]]
|
|
|
|
; v9pic32: add %[[R1]], %lo(G), %[[Goffs:[gilo][0-7]]]
|
|
|
|
; v9pic32: ldx [%[[GOT:[gilo][0-7]]]+%[[Goffs]]], %[[Gaddr:[gilo][0-7]]]
|
2013-09-22 09:40:24 +08:00
|
|
|
; v9pic32: ldub [%[[Gaddr]]], %i0
|
2014-01-10 10:55:27 +08:00
|
|
|
; v9pic32: ret
|
2013-09-22 09:40:24 +08:00
|
|
|
; v9pic32: restore
|
2013-06-02 10:24:27 +08:00
|
|
|
|