2011-04-06 05:40:41 +08:00
|
|
|
;RUN: llc -march=sparc < %s | FileCheck %s -check-prefix=V8
|
|
|
|
;RUN: llc -march=sparc -mattr=v9 < %s | FileCheck %s -check-prefix=V9
|
|
|
|
;RUN: llc -march=sparc -regalloc=basic < %s | FileCheck %s -check-prefix=V8
|
|
|
|
;RUN: llc -march=sparc -regalloc=basic -mattr=v9 < %s | FileCheck %s -check-prefix=V9
|
2013-06-02 04:42:48 +08:00
|
|
|
|
2011-01-12 13:08:36 +08:00
|
|
|
|
|
|
|
define i8* @frameaddr() nounwind readnone {
|
|
|
|
entry:
|
2013-07-19 06:47:09 +08:00
|
|
|
;V8-LABEL: frameaddr:
|
2013-06-03 05:48:17 +08:00
|
|
|
;V8: save %sp, -96, %sp
|
|
|
|
;V8: jmp %i7+8
|
|
|
|
;V8: restore %g0, %fp, %o0
|
2011-01-22 06:00:00 +08:00
|
|
|
|
2013-07-19 06:47:09 +08:00
|
|
|
;V9-LABEL: frameaddr:
|
2013-06-03 05:48:17 +08:00
|
|
|
;V9: save %sp, -96, %sp
|
|
|
|
;V9: jmp %i7+8
|
|
|
|
;V9: restore %g0, %fp, %o0
|
2011-01-12 13:08:36 +08:00
|
|
|
%0 = tail call i8* @llvm.frameaddress(i32 0)
|
|
|
|
ret i8* %0
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8* @frameaddr2() nounwind readnone {
|
|
|
|
entry:
|
2013-07-19 06:47:09 +08:00
|
|
|
;V8-LABEL: frameaddr2:
|
2011-01-22 06:00:00 +08:00
|
|
|
;V8: ta 3
|
|
|
|
;V8: ld [%fp+56], {{.+}}
|
|
|
|
;V8: ld [{{.+}}+56], {{.+}}
|
|
|
|
;V8: ld [{{.+}}+56], {{.+}}
|
|
|
|
|
2013-07-19 06:47:09 +08:00
|
|
|
;V9-LABEL: frameaddr2:
|
2011-01-22 06:00:00 +08:00
|
|
|
;V9: flushw
|
|
|
|
;V9: ld [%fp+56], {{.+}}
|
|
|
|
;V9: ld [{{.+}}+56], {{.+}}
|
|
|
|
;V9: ld [{{.+}}+56], {{.+}}
|
2011-01-12 13:08:36 +08:00
|
|
|
%0 = tail call i8* @llvm.frameaddress(i32 3)
|
|
|
|
ret i8* %0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i8* @llvm.frameaddress(i32) nounwind readnone
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
define i8* @retaddr() nounwind readnone {
|
|
|
|
entry:
|
2013-07-19 06:47:09 +08:00
|
|
|
;V8-LABEL: retaddr:
|
2013-06-02 10:24:27 +08:00
|
|
|
;V8: or %g0, %o7, {{.+}}
|
2011-01-22 06:00:00 +08:00
|
|
|
|
2013-07-19 06:47:09 +08:00
|
|
|
;V9-LABEL: retaddr:
|
2013-06-02 10:24:27 +08:00
|
|
|
;V9: or %g0, %o7, {{.+}}
|
2013-06-02 04:42:48 +08:00
|
|
|
|
2011-01-12 13:08:36 +08:00
|
|
|
%0 = tail call i8* @llvm.returnaddress(i32 0)
|
|
|
|
ret i8* %0
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8* @retaddr2() nounwind readnone {
|
|
|
|
entry:
|
2013-07-19 06:47:09 +08:00
|
|
|
;V8-LABEL: retaddr2:
|
2011-01-22 06:00:00 +08:00
|
|
|
;V8: ta 3
|
|
|
|
;V8: ld [%fp+56], {{.+}}
|
|
|
|
;V8: ld [{{.+}}+56], {{.+}}
|
|
|
|
;V8: ld [{{.+}}+60], {{.+}}
|
|
|
|
|
2013-07-19 06:47:09 +08:00
|
|
|
;V9-LABEL: retaddr2:
|
2011-01-22 06:00:00 +08:00
|
|
|
;V9: flushw
|
|
|
|
;V9: ld [%fp+56], {{.+}}
|
|
|
|
;V9: ld [{{.+}}+56], {{.+}}
|
|
|
|
;V9: ld [{{.+}}+60], {{.+}}
|
2013-06-02 04:42:48 +08:00
|
|
|
|
2013-07-19 06:47:09 +08:00
|
|
|
;V8LEAF-LABEL: retaddr2:
|
2013-06-02 04:42:48 +08:00
|
|
|
;V8LEAF: ta 3
|
|
|
|
;V8LEAF: ld [%fp+56], %[[R:[goli][0-7]]]
|
|
|
|
;V8LEAF: ld [%[[R]]+56], %[[R1:[goli][0-7]]]
|
|
|
|
;V8LEAF: ld [%[[R1]]+60], {{.+}}
|
|
|
|
|
2013-07-19 06:47:09 +08:00
|
|
|
;V9LEAF-LABEL: retaddr2:
|
2013-06-02 04:42:48 +08:00
|
|
|
;V9LEAF: flushw
|
|
|
|
;V9LEAF: ld [%fp+56], %[[R:[goli][0-7]]]
|
|
|
|
;V9LEAF: ld [%[[R]]+56], %[[R1:[goli][0-7]]]
|
|
|
|
;V9LEAF: ld [%[[R1]]+60], {{.+}}
|
|
|
|
|
2011-01-12 13:08:36 +08:00
|
|
|
%0 = tail call i8* @llvm.returnaddress(i32 3)
|
|
|
|
ret i8* %0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i8* @llvm.returnaddress(i32) nounwind readnone
|