2014-03-01 15:46:33 +08:00
|
|
|
# RUN: llvm-mc --disassemble %s -triple=sparcv9-unknown-linux | FileCheck %s
|
|
|
|
|
|
|
|
# CHECK: ldsb [%i0+%l6], %o2
|
|
|
|
0xd4 0x4e 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: ldsb [%i0+32], %o2
|
|
|
|
0xd4 0x4e 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: ldsb [%g1], %o4
|
|
|
|
0xd8 0x48 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: ldsb [%g1], %o4
|
|
|
|
0xd8 0x48 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: ldsh [%i0+%l6], %o2
|
|
|
|
0xd4 0x56 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: ldsh [%i0+32], %o2
|
|
|
|
0xd4 0x56 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: ldsh [%g1], %o4
|
|
|
|
0xd8 0x50 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: ldsh [%g1], %o4
|
|
|
|
0xd8 0x50 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: ldub [%i0+%l6], %o2
|
|
|
|
0xd4 0x0e 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: ldub [%i0+32], %o2
|
|
|
|
0xd4 0x0e 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: ldub [%g1], %o2
|
|
|
|
0xd4 0x08 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: ldub [%g1], %o2
|
|
|
|
0xd4 0x08 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: lduh [%i0+%l6], %o2
|
|
|
|
0xd4 0x16 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: lduh [%i0+32], %o2
|
|
|
|
0xd4 0x16 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: lduh [%g1], %o2
|
|
|
|
0xd4 0x10 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: lduh [%g1], %o2
|
|
|
|
0xd4 0x10 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: ld [%i0+%l6], %o2
|
|
|
|
0xd4 0x06 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: ld [%i0+32], %o2
|
|
|
|
0xd4 0x06 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: ld [%g1], %o2
|
|
|
|
0xd4 0x00 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: ld [%g1], %o2
|
|
|
|
0xd4 0x00 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: ld [%i0+%l6], %f2
|
|
|
|
0xc5 0x06 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: ld [%i0+32], %f2
|
|
|
|
0xc5 0x06 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: ld [%g1], %f2
|
|
|
|
0xc5 0x00 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: ld [%g1], %f2
|
|
|
|
0xc5 0x00 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: ldd [%i0+%l6], %f2
|
|
|
|
0xc5 0x1e 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: ldd [%i0+32], %f2
|
|
|
|
0xc5 0x1e 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: ldd [%g1], %f2
|
|
|
|
0xc5 0x18 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: ldd [%g1], %f2
|
|
|
|
0xc5 0x18 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: ldq [%i0+%l6], %f4
|
|
|
|
0xc9 0x16 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: ldq [%i0+32], %f4
|
|
|
|
0xc9 0x16 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: ldq [%g1], %f4
|
|
|
|
0xc9 0x10 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: ldq [%g1], %f4
|
|
|
|
0xc9 0x10 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: ldx [%i0+%l6], %o2
|
|
|
|
0xd4 0x5e 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: ldx [%i0+32], %o2
|
|
|
|
0xd4 0x5e 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: ldx [%g1], %o2
|
|
|
|
0xd4 0x58 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: ldx [%g1], %o2
|
|
|
|
0xd4 0x58 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: ldsw [%i0+%l6], %o2
|
|
|
|
0xd4 0x46 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: ldsw [%i0+32], %o2
|
|
|
|
0xd4 0x46 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: ldsw [%g1], %o2
|
|
|
|
0xd4 0x40 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: ldsw [%g1], %o2
|
|
|
|
0xd4 0x40 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: stb %o2, [%i0+%l6]
|
|
|
|
0xd4 0x2e 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: stb %o2, [%i0+32]
|
|
|
|
0xd4 0x2e 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: stb %o2, [%g1]
|
|
|
|
0xd4 0x28 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: stb %o2, [%g1]
|
|
|
|
0xd4 0x28 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: sth %o2, [%i0+%l6]
|
|
|
|
0xd4 0x36 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: sth %o2, [%i0+32]
|
|
|
|
0xd4 0x36 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: sth %o2, [%g1]
|
|
|
|
0xd4 0x30 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: sth %o2, [%g1]
|
|
|
|
0xd4 0x30 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: st %o2, [%i0+%l6]
|
|
|
|
0xd4 0x26 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: st %o2, [%i0+32]
|
|
|
|
0xd4 0x26 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: st %o2, [%g1]
|
|
|
|
0xd4 0x20 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: st %o2, [%g1]
|
|
|
|
0xd4 0x20 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: st %f2, [%i0+%l6]
|
|
|
|
0xc5 0x26 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: st %f2, [%i0+32]
|
|
|
|
0xc5 0x26 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: st %f2, [%g1]
|
|
|
|
0xc5 0x20 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: st %f2, [%g1]
|
|
|
|
0xc5 0x20 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: std %f2, [%i0+%l6]
|
|
|
|
0xc5 0x3e 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: std %f2, [%i0+32]
|
|
|
|
0xc5 0x3e 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: std %f2, [%g1]
|
|
|
|
0xc5 0x38 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: std %f2, [%g1]
|
|
|
|
0xc5 0x38 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: stq %f4, [%i0+%l6]
|
|
|
|
0xc9 0x36 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: stq %f4, [%i0+32]
|
|
|
|
0xc9 0x36 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: stq %f4, [%g1]
|
|
|
|
0xc9 0x30 0x60 0x00
|
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: stq %f4, [%g1]
|
|
|
|
0xc9 0x30 0x40 0x00
|
|
|
|
|
2014-03-01 15:46:33 +08:00
|
|
|
# CHECK: stx %o2, [%i0+%l6]
|
|
|
|
0xd4 0x76 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: stx %o2, [%i0+32]
|
|
|
|
0xd4 0x76 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: stx %o2, [%g1]
|
|
|
|
0xd4 0x70 0x60 0x00
|
2014-03-10 07:32:07 +08:00
|
|
|
|
2015-04-29 22:54:44 +08:00
|
|
|
# CHECK: stx %o2, [%g1]
|
|
|
|
0xd4 0x70 0x40 0x00
|
|
|
|
|
2014-03-10 07:32:07 +08:00
|
|
|
# CHECK: swap [%i0+%l6], %o2
|
|
|
|
0xd4 0x7e 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: swap [%i0+32], %o2
|
|
|
|
0xd4 0x7e 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: swap [%g1], %o2
|
|
|
|
0xd4 0x78 0x60 0x00
|
2015-04-29 22:54:44 +08:00
|
|
|
|
|
|
|
# CHECK: swap [%g1], %o2
|
|
|
|
0xd4 0x78 0x40 0x00
|
Sparc: Add the "alternate address space" load/store instructions.
- Adds support for the asm syntax, which has an immediate integer
"ASI" (address space identifier) appearing after an address, before
a comma.
- Adds the various-width load, store, and swap in alternate address
space instructions. (ldsba, ldsha, lduba, lduha, lda, stba, stha,
sta, swapa)
This does not attempt to hook these instructions up to pointer address
spaces in LLVM, although that would probably be a reasonable thing to
do in the future.
Differential Revision: http://reviews.llvm.org/D8904
llvm-svn: 237581
2015-05-19 00:35:04 +08:00
|
|
|
|
|
|
|
# CHECK: swapa [%i0+%l6] 131, %o2
|
|
|
|
0xd4 0xfe 0x10 0x76
|
|
|
|
|
|
|
|
# CHECK: swapa [%g1] 131, %o2
|
|
|
|
0xd4 0xf8 0x50 0x60
|
[Sparc] Implement i64 load/store support for 32-bit sparc.
The LDD/STD instructions can load/store a 64bit quantity from/to
memory to/from a consecutive even/odd pair of (32-bit) registers. They
are part of SparcV8, and also present in SparcV9. (Although deprecated
there, as you can store 64bits in one register).
As recommended on llvmdev in the thread "How to enable use of 64bit
load/store for 32bit architecture" from Apr 2015, I've modeled the
64-bit load/store operations as working on a v2i32 type, rather than
making i64 a legal type, but with few legal operations. The latter
does not (currently) work, as there is much code in llvm which assumes
that if i64 is legal, operations like "add" will actually work on it.
The same assumption does not hold for v2i32 -- for vector types, it is
workable to support only load/store, and expand everything else.
This patch:
- Adds a new register class, IntPair, for even/odd pairs of registers.
- Modifies the list of reserved registers, the stack spilling code,
and register copying code to support the IntPair register class.
- Adds support in AsmParser. (note that in asm text, you write the
name of the first register of the pair only. So the parser has to
morph the single register into the equivalent paired register).
- Adds the new instructions themselves (LDD/STD/LDDA/STDA).
- Hooks up the instructions and registers as a vector type v2i32. Adds
custom legalizer to transform i64 load/stores into v2i32 load/stores
and bitcasts, so that the new instructions can actually be
generated, and marks all operations other than load/store on v2i32
as needing to be expanded.
- Copies the unfortunate SelectInlineAsm hack from ARMISelDAGToDAG.
This hack undoes the transformation of i64 operands into two
arbitrarily-allocated separate i32 registers in
SelectionDAGBuilder. and instead passes them in a single
IntPair. (Arbitrarily allocated registers are not useful, asm code
expects to be receiving a pair, which can be passed to ldd/std.)
Also adds a bunch of test cases covering all the bugs I've added along
the way.
Differential Revision: http://reviews.llvm.org/D8713
llvm-svn: 244484
2015-08-11 03:11:39 +08:00
|
|
|
|
|
|
|
# CHECK: ldd [%i0+%l6], %o2
|
|
|
|
0xd4 0x1e 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: ldd [%i0+32], %o2
|
|
|
|
0xd4 0x1e 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: ldd [%g1], %o2
|
|
|
|
0xd4 0x18 0x60 0x00
|
|
|
|
|
|
|
|
# CHECK: ldd [%g1], %o2
|
|
|
|
0xd4 0x18 0x40 0x00
|
|
|
|
|
|
|
|
# CHECK: std %o2, [%i0+%l6]
|
|
|
|
0xd4 0x3e 0x00 0x16
|
|
|
|
|
|
|
|
# CHECK: std %o2, [%i0+32]
|
|
|
|
0xd4 0x3e 0x20 0x20
|
|
|
|
|
|
|
|
# CHECK: std %o2, [%g1]
|
|
|
|
0xd4 0x38 0x60 0x00
|
|
|
|
|
|
|
|
# CHECK: std %o2, [%g1]
|
|
|
|
0xd4 0x38 0x40 0x00
|