brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 286750a Raw
52 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -relocation-model=pic -mtriple=sparc | FileCheck --check-prefix=SPARC %s3; RUN: llc < %s -relocation-model=pic -mtriple=sparcv9 | FileCheck --check-prefix=SPARC64 %s4 5;; SPARC32 and SPARC64 for classic UltraSPARCs implement GETPCX6;; with a fake `call`.7;; All other SPARC64 targets implement it with `rd %pc, %o7`.8;; Need to do the tests in separate files because apparently `tune-cpu`9;; attribute applies to the entire file at once.10 11@value = external global i3212 13define i32 @testRdpc() nounwind #0 {14; SPARC-LABEL: testRdpc:15; SPARC:       ! %bb.0:16; SPARC-NEXT:    save %sp, -96, %sp17; SPARC-NEXT:  .Ltmp0:18; SPARC-NEXT:    call .Ltmp119; SPARC-NEXT:  .Ltmp2:20; SPARC-NEXT:    sethi %hi(_GLOBAL_OFFSET_TABLE_+(.Ltmp2-.Ltmp0)), %i021; SPARC-NEXT:  .Ltmp1:22; SPARC-NEXT:    or %i0, %lo(_GLOBAL_OFFSET_TABLE_+(.Ltmp1-.Ltmp0)), %i023; SPARC-NEXT:    add %i0, %o7, %i024; SPARC-NEXT:    sethi %hi(value), %i125; SPARC-NEXT:    add %i1, %lo(value), %i126; SPARC-NEXT:    ld [%i0+%i1], %i027; SPARC-NEXT:    ld [%i0], %i028; SPARC-NEXT:    ret29; SPARC-NEXT:    restore30;31; SPARC64-LABEL: testRdpc:32; SPARC64:       ! %bb.0:33; SPARC64-NEXT:    save %sp, -128, %sp34; SPARC64-NEXT:  .Ltmp0:35; SPARC64-NEXT:    rd %pc, %o736; SPARC64-NEXT:  .Ltmp2:37; SPARC64-NEXT:    sethi %hi(_GLOBAL_OFFSET_TABLE_+(.Ltmp2-.Ltmp0)), %i038; SPARC64-NEXT:  .Ltmp1:39; SPARC64-NEXT:    or %i0, %lo(_GLOBAL_OFFSET_TABLE_+(.Ltmp1-.Ltmp0)), %i040; SPARC64-NEXT:    add %i0, %o7, %i041; SPARC64-NEXT:    sethi %hi(value), %i142; SPARC64-NEXT:    add %i1, %lo(value), %i143; SPARC64-NEXT:    ldx [%i0+%i1], %i044; SPARC64-NEXT:    ld [%i0], %i045; SPARC64-NEXT:    ret46; SPARC64-NEXT:    restore47  %1 = load i32, ptr @value48  ret i32 %149}50 51attributes #0 = { "tune-cpu"="niagara" }52