Home | History | Annotate | Download | only in SPARC
      1 ;RUN: llc -march=sparc < %s | FileCheck %s -check-prefix=V8
      2 ;RUN: llc -march=sparc -mattr=v9 < %s | FileCheck %s -check-prefix=V9
      3 ;RUN: llc -march=sparc -regalloc=basic < %s | FileCheck %s -check-prefix=V8
      4 ;RUN: llc -march=sparc -regalloc=basic -mattr=v9 < %s | FileCheck %s -check-prefix=V9
      5 
      6 define i8* @frameaddr() nounwind readnone {
      7 entry:
      8 ;V8: frameaddr
      9 ;V8: or %g0, %fp, {{.+}}
     10 
     11 ;V9: frameaddr
     12 ;V9: or %g0, %fp, {{.+}}
     13   %0 = tail call i8* @llvm.frameaddress(i32 0)
     14   ret i8* %0
     15 }
     16 
     17 define i8* @frameaddr2() nounwind readnone {
     18 entry:
     19 ;V8: frameaddr2
     20 ;V8: ta 3
     21 ;V8: ld [%fp+56], {{.+}}
     22 ;V8: ld [{{.+}}+56], {{.+}}
     23 ;V8: ld [{{.+}}+56], {{.+}}
     24 
     25 ;V9: frameaddr2
     26 ;V9: flushw
     27 ;V9: ld [%fp+56], {{.+}}
     28 ;V9: ld [{{.+}}+56], {{.+}}
     29 ;V9: ld [{{.+}}+56], {{.+}}
     30   %0 = tail call i8* @llvm.frameaddress(i32 3)
     31   ret i8* %0
     32 }
     33 
     34 declare i8* @llvm.frameaddress(i32) nounwind readnone
     35 
     36 
     37 
     38 define i8* @retaddr() nounwind readnone {
     39 entry:
     40 ;V8: retaddr
     41 ;V8: or %g0, %i7, {{.+}}
     42 
     43 ;V9: retaddr
     44 ;V9: or %g0, %i7, {{.+}}
     45   %0 = tail call i8* @llvm.returnaddress(i32 0)
     46   ret i8* %0
     47 }
     48 
     49 define i8* @retaddr2() nounwind readnone {
     50 entry:
     51 ;V8: retaddr2
     52 ;V8: ta 3
     53 ;V8: ld [%fp+56], {{.+}}
     54 ;V8: ld [{{.+}}+56], {{.+}}
     55 ;V8: ld [{{.+}}+60], {{.+}}
     56 
     57 ;V9: retaddr2
     58 ;V9: flushw
     59 ;V9: ld [%fp+56], {{.+}}
     60 ;V9: ld [{{.+}}+56], {{.+}}
     61 ;V9: ld [{{.+}}+60], {{.+}}
     62   %0 = tail call i8* @llvm.returnaddress(i32 3)
     63   ret i8* %0
     64 }
     65 
     66 declare i8* @llvm.returnaddress(i32) nounwind readnone
     67