2018-07-16 14:28:26 +02:00
|
|
|
;RUN: llc -march=sparc -show-mc-encoding < %s | FileCheck %s -check-prefix=V8
|
2011-04-05 23:40:41 +02:00
|
|
|
;RUN: llc -march=sparc -mattr=v9 < %s | FileCheck %s -check-prefix=V9
|
2018-07-16 14:28:26 +02:00
|
|
|
;RUN: llc -march=sparc -show-mc-encoding -regalloc=basic < %s | FileCheck %s -check-prefix=V8
|
2011-04-05 23:40:41 +02:00
|
|
|
;RUN: llc -march=sparc -regalloc=basic -mattr=v9 < %s | FileCheck %s -check-prefix=V9
|
2014-01-04 08:17:21 +01:00
|
|
|
;RUN: llc -march=sparcv9 < %s | FileCheck %s -check-prefix=SPARC64
|
2013-06-01 22:42:48 +02:00
|
|
|
|
2011-01-12 06:08:36 +01:00
|
|
|
|
|
|
|
define i8* @frameaddr() nounwind readnone {
|
|
|
|
entry:
|
2013-07-19 00:47:09 +02:00
|
|
|
;V8-LABEL: frameaddr:
|
2013-06-02 23:48:17 +02:00
|
|
|
;V8: save %sp, -96, %sp
|
2014-01-10 03:55:27 +01:00
|
|
|
;V8: ret
|
2013-06-02 23:48:17 +02:00
|
|
|
;V8: restore %g0, %fp, %o0
|
2011-01-21 23:00:00 +01:00
|
|
|
|
2013-07-19 00:47:09 +02:00
|
|
|
;V9-LABEL: frameaddr:
|
2013-06-02 23:48:17 +02:00
|
|
|
;V9: save %sp, -96, %sp
|
2014-01-10 03:55:27 +01:00
|
|
|
;V9: ret
|
2013-06-02 23:48:17 +02:00
|
|
|
;V9: restore %g0, %fp, %o0
|
2014-01-04 08:17:21 +01:00
|
|
|
|
|
|
|
;SPARC64-LABEL: frameaddr
|
|
|
|
;SPARC64: save %sp, -128, %sp
|
|
|
|
;SPARC64: add %fp, 2047, %i0
|
2014-01-10 03:55:27 +01:00
|
|
|
;SPARC64: ret
|
2014-03-01 02:04:26 +01:00
|
|
|
;SPARC64-NOT: restore %g0, %g0, %g0
|
|
|
|
;SPARC64: restore
|
2014-01-04 08:17:21 +01:00
|
|
|
|
2011-01-12 06:08:36 +01:00
|
|
|
%0 = tail call i8* @llvm.frameaddress(i32 0)
|
|
|
|
ret i8* %0
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8* @frameaddr2() nounwind readnone {
|
|
|
|
entry:
|
2013-07-19 00:47:09 +02:00
|
|
|
;V8-LABEL: frameaddr2:
|
2018-07-16 14:28:26 +02:00
|
|
|
;V8: ta 3 ! encoding: [0x91,0xd0,0x20,0x03]
|
2011-01-21 23:00:00 +01:00
|
|
|
;V8: ld [%fp+56], {{.+}}
|
|
|
|
;V8: ld [{{.+}}+56], {{.+}}
|
|
|
|
;V8: ld [{{.+}}+56], {{.+}}
|
|
|
|
|
2013-07-19 00:47:09 +02:00
|
|
|
;V9-LABEL: frameaddr2:
|
2011-01-21 23:00:00 +01:00
|
|
|
;V9: flushw
|
|
|
|
;V9: ld [%fp+56], {{.+}}
|
|
|
|
;V9: ld [{{.+}}+56], {{.+}}
|
|
|
|
;V9: ld [{{.+}}+56], {{.+}}
|
2014-01-04 08:17:21 +01:00
|
|
|
|
|
|
|
;SPARC64-LABEL: frameaddr2
|
|
|
|
;SPARC64: flushw
|
|
|
|
;SPARC64: ldx [%fp+2159], %[[R0:[goli][0-7]]]
|
|
|
|
;SPARC64: ldx [%[[R0]]+2159], %[[R1:[goli][0-7]]]
|
|
|
|
;SPARC64: ldx [%[[R1]]+2159], %[[R2:[goli][0-7]]]
|
|
|
|
;SPARC64: add %[[R2]], 2047, {{.+}}
|
|
|
|
|
2011-01-12 06:08:36 +01: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 00:47:09 +02:00
|
|
|
;V8-LABEL: retaddr:
|
TableGen: fix operand counting for aliases
TableGen has a fairly dubious heuristic to decide whether an alias should be
printed: does the alias have lest operands than the real instruction. This is
bad enough (particularly with no way to override it), but it should at least be
calculated consistently for both strings.
This patch implements that logic: first get the *correct* string for the
variant, in the same way as the Matcher, without guessing; then count the
number of whitespace chars.
There are basically 4 changes this brings about after the previous
commits; all of these appear to be good, so I have changed the tests:
+ ARM64: we print "neg X, Y" instead of "sub X, xzr, Y".
+ ARM64: we skip implicit "uxtx" and "uxtw" modifiers.
+ Sparc: we print "mov A, B" instead of "or %g0, A, B".
+ Sparc: we print "fcmpX A, B" instead of "fcmpX %fcc0, A, B"
llvm-svn: 208969
2014-05-16 11:42:04 +02:00
|
|
|
;V8: mov %o7, {{.+}}
|
2011-01-21 23:00:00 +01:00
|
|
|
|
2013-07-19 00:47:09 +02:00
|
|
|
;V9-LABEL: retaddr:
|
TableGen: fix operand counting for aliases
TableGen has a fairly dubious heuristic to decide whether an alias should be
printed: does the alias have lest operands than the real instruction. This is
bad enough (particularly with no way to override it), but it should at least be
calculated consistently for both strings.
This patch implements that logic: first get the *correct* string for the
variant, in the same way as the Matcher, without guessing; then count the
number of whitespace chars.
There are basically 4 changes this brings about after the previous
commits; all of these appear to be good, so I have changed the tests:
+ ARM64: we print "neg X, Y" instead of "sub X, xzr, Y".
+ ARM64: we skip implicit "uxtx" and "uxtw" modifiers.
+ Sparc: we print "mov A, B" instead of "or %g0, A, B".
+ Sparc: we print "fcmpX A, B" instead of "fcmpX %fcc0, A, B"
llvm-svn: 208969
2014-05-16 11:42:04 +02:00
|
|
|
;V9: mov %o7, {{.+}}
|
2013-06-01 22:42:48 +02:00
|
|
|
|
2014-01-04 08:17:21 +01:00
|
|
|
;SPARC64-LABEL: retaddr
|
TableGen: fix operand counting for aliases
TableGen has a fairly dubious heuristic to decide whether an alias should be
printed: does the alias have lest operands than the real instruction. This is
bad enough (particularly with no way to override it), but it should at least be
calculated consistently for both strings.
This patch implements that logic: first get the *correct* string for the
variant, in the same way as the Matcher, without guessing; then count the
number of whitespace chars.
There are basically 4 changes this brings about after the previous
commits; all of these appear to be good, so I have changed the tests:
+ ARM64: we print "neg X, Y" instead of "sub X, xzr, Y".
+ ARM64: we skip implicit "uxtx" and "uxtw" modifiers.
+ Sparc: we print "mov A, B" instead of "or %g0, A, B".
+ Sparc: we print "fcmpX A, B" instead of "fcmpX %fcc0, A, B"
llvm-svn: 208969
2014-05-16 11:42:04 +02:00
|
|
|
;SPARC64: mov %o7, {{.+}}
|
2014-01-04 08:17:21 +01:00
|
|
|
|
2011-01-12 06:08:36 +01:00
|
|
|
%0 = tail call i8* @llvm.returnaddress(i32 0)
|
|
|
|
ret i8* %0
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8* @retaddr2() nounwind readnone {
|
|
|
|
entry:
|
2013-07-19 00:47:09 +02:00
|
|
|
;V8-LABEL: retaddr2:
|
2011-01-21 23:00:00 +01:00
|
|
|
;V8: ta 3
|
|
|
|
;V8: ld [%fp+56], {{.+}}
|
|
|
|
;V8: ld [{{.+}}+56], {{.+}}
|
|
|
|
;V8: ld [{{.+}}+60], {{.+}}
|
|
|
|
|
2013-07-19 00:47:09 +02:00
|
|
|
;V9-LABEL: retaddr2:
|
2011-01-21 23:00:00 +01:00
|
|
|
;V9: flushw
|
|
|
|
;V9: ld [%fp+56], {{.+}}
|
|
|
|
;V9: ld [{{.+}}+56], {{.+}}
|
|
|
|
;V9: ld [{{.+}}+60], {{.+}}
|
2013-06-01 22:42:48 +02:00
|
|
|
|
2014-01-04 08:17:21 +01:00
|
|
|
;SPARC64-LABEL: retaddr2
|
|
|
|
;SPARC64: flushw
|
|
|
|
;SPARC64: ldx [%fp+2159], %[[R0:[goli][0-7]]]
|
|
|
|
;SPARC64: ldx [%[[R0]]+2159], %[[R1:[goli][0-7]]]
|
|
|
|
;SPARC64: ldx [%[[R1]]+2167], {{.+}}
|
2013-06-01 22:42:48 +02:00
|
|
|
|
2011-01-12 06:08:36 +01:00
|
|
|
%0 = tail call i8* @llvm.returnaddress(i32 3)
|
|
|
|
ret i8* %0
|
|
|
|
}
|
|
|
|
|
2018-08-17 11:18:31 +02:00
|
|
|
define i8* @retaddr3() nounwind readnone {
|
|
|
|
entry:
|
|
|
|
;V8-LABEL: retaddr3:
|
|
|
|
;V8: ta 3
|
|
|
|
;V8: ld [%fp+60], {{.+}}
|
|
|
|
|
|
|
|
;V9-LABEL: retaddr3:
|
|
|
|
;V9: flushw
|
|
|
|
;V9: ld [%fp+60], {{.+}}
|
|
|
|
|
|
|
|
;SPARC64-LABEL: retaddr3
|
|
|
|
;SPARC64: flushw
|
|
|
|
;SPARC64: ldx [%fp+2167], %[[R0:[goli][0-7]]]
|
|
|
|
|
|
|
|
%0 = tail call i8* @llvm.returnaddress(i32 1)
|
|
|
|
ret i8* %0
|
|
|
|
}
|
|
|
|
|
2011-01-12 06:08:36 +01:00
|
|
|
declare i8* @llvm.returnaddress(i32) nounwind readnone
|