From eddfaad1ef9a208a8a9ee23c26fac4d980caa99a Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Fri, 19 Jul 2013 16:09:03 +0000 Subject: [SystemZ] Start adding z196 and zEC12 support This first step just adds definitions for SLLK, SRLK and SRAK. The next patch will actually make use of them during codegen. insn-bad.s tests that some form of error is reported when using these instructions on z10. More work is needed to get the "instruction requires: distinct-ops" that we'd ideally like, so I've stubbed that part out for now. I'll come back and make it mandatory once the necessary changes are in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186680 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/MC/Disassembler/SystemZ/insns.txt | 110 ++++++++++++++++++++++++++++++++- test/MC/SystemZ/insn-bad-z196.s | 44 +++++++++++++ test/MC/SystemZ/insn-bad.s | 18 +++++- test/MC/SystemZ/insn-good-z196.s | 80 ++++++++++++++++++++++++ test/MC/SystemZ/insn-good.s | 1 + 5 files changed, 251 insertions(+), 2 deletions(-) create mode 100644 test/MC/SystemZ/insn-bad-z196.s create mode 100644 test/MC/SystemZ/insn-good-z196.s (limited to 'test/MC') diff --git a/test/MC/Disassembler/SystemZ/insns.txt b/test/MC/Disassembler/SystemZ/insns.txt index 101a1683aa..6f5e332160 100644 --- a/test/MC/Disassembler/SystemZ/insns.txt +++ b/test/MC/Disassembler/SystemZ/insns.txt @@ -1,5 +1,5 @@ # Test instructions that don't have PC-relative operands. -# RUN: llvm-mc --disassemble %s -triple=s390x-linux-gnu | FileCheck %s +# RUN: llvm-mc --disassemble %s -triple=s390x-linux-gnu -mcpu=zEC12 | FileCheck %s # CHECK: adbr %f0, %f0 0xb3 0x1a 0x00 0x00 @@ -5215,6 +5215,42 @@ # CHECK: sllg %r0, %r0, 524287(%r15) 0xeb 0x00 0xff 0xff 0x7f 0x0d +# CHECK: sllk %r0, %r0, 0 +0xeb 0x00 0x00 0x00 0x00 0xdf + +# CHECK: sllk %r15, %r1, 0 +0xeb 0xf1 0x00 0x00 0x00 0xdf + +# CHECK: sllk %r1, %r15, 0 +0xeb 0x1f 0x00 0x00 0x00 0xdf + +# CHECK: sllk %r15, %r15, 0 +0xeb 0xff 0x00 0x00 0x00 0xdf + +# CHECK: sllk %r0, %r0, -524288 +0xeb 0x00 0x00 0x00 0x80 0xdf + +# CHECK: sllk %r0, %r0, -1 +0xeb 0x00 0x0f 0xff 0xff 0xdf + +# CHECK: sllk %r0, %r0, 1 +0xeb 0x00 0x00 0x01 0x00 0xdf + +# CHECK: sllk %r0, %r0, 524287 +0xeb 0x00 0x0f 0xff 0x7f 0xdf + +# CHECK: sllk %r0, %r0, 0(%r1) +0xeb 0x00 0x10 0x00 0x00 0xdf + +# CHECK: sllk %r0, %r0, 0(%r15) +0xeb 0x00 0xf0 0x00 0x00 0xdf + +# CHECK: sllk %r0, %r0, 524287(%r1) +0xeb 0x00 0x1f 0xff 0x7f 0xdf + +# CHECK: sllk %r0, %r0, 524287(%r15) +0xeb 0x00 0xff 0xff 0x7f 0xdf + # CHECK: sll %r0, 0 0x89 0x00 0x00 0x00 @@ -5416,6 +5452,42 @@ # CHECK: srag %r0, %r0, 524287(%r15) 0xeb 0x00 0xff 0xff 0x7f 0x0a +# CHECK: srak %r0, %r0, 0 +0xeb 0x00 0x00 0x00 0x00 0xdc + +# CHECK: srak %r15, %r1, 0 +0xeb 0xf1 0x00 0x00 0x00 0xdc + +# CHECK: srak %r1, %r15, 0 +0xeb 0x1f 0x00 0x00 0x00 0xdc + +# CHECK: srak %r15, %r15, 0 +0xeb 0xff 0x00 0x00 0x00 0xdc + +# CHECK: srak %r0, %r0, -524288 +0xeb 0x00 0x00 0x00 0x80 0xdc + +# CHECK: srak %r0, %r0, -1 +0xeb 0x00 0x0f 0xff 0xff 0xdc + +# CHECK: srak %r0, %r0, 1 +0xeb 0x00 0x00 0x01 0x00 0xdc + +# CHECK: srak %r0, %r0, 524287 +0xeb 0x00 0x0f 0xff 0x7f 0xdc + +# CHECK: srak %r0, %r0, 0(%r1) +0xeb 0x00 0x10 0x00 0x00 0xdc + +# CHECK: srak %r0, %r0, 0(%r15) +0xeb 0x00 0xf0 0x00 0x00 0xdc + +# CHECK: srak %r0, %r0, 524287(%r1) +0xeb 0x00 0x1f 0xff 0x7f 0xdc + +# CHECK: srak %r0, %r0, 524287(%r15) +0xeb 0x00 0xff 0xff 0x7f 0xdc + # CHECK: sra %r0, 0 0x8a 0x00 0x00 0x00 @@ -5476,6 +5548,42 @@ # CHECK: srlg %r0, %r0, 524287(%r15) 0xeb 0x00 0xff 0xff 0x7f 0x0c +# CHECK: srlk %r0, %r0, 0 +0xeb 0x00 0x00 0x00 0x00 0xde + +# CHECK: srlk %r15, %r1, 0 +0xeb 0xf1 0x00 0x00 0x00 0xde + +# CHECK: srlk %r1, %r15, 0 +0xeb 0x1f 0x00 0x00 0x00 0xde + +# CHECK: srlk %r15, %r15, 0 +0xeb 0xff 0x00 0x00 0x00 0xde + +# CHECK: srlk %r0, %r0, -524288 +0xeb 0x00 0x00 0x00 0x80 0xde + +# CHECK: srlk %r0, %r0, -1 +0xeb 0x00 0x0f 0xff 0xff 0xde + +# CHECK: srlk %r0, %r0, 1 +0xeb 0x00 0x00 0x01 0x00 0xde + +# CHECK: srlk %r0, %r0, 524287 +0xeb 0x00 0x0f 0xff 0x7f 0xde + +# CHECK: srlk %r0, %r0, 0(%r1) +0xeb 0x00 0x10 0x00 0x00 0xde + +# CHECK: srlk %r0, %r0, 0(%r15) +0xeb 0x00 0xf0 0x00 0x00 0xde + +# CHECK: srlk %r0, %r0, 524287(%r1) +0xeb 0x00 0x1f 0xff 0x7f 0xde + +# CHECK: srlk %r0, %r0, 524287(%r15) +0xeb 0x00 0xff 0xff 0x7f 0xde + # CHECK: srl %r0, 0 0x88 0x00 0x00 0x00 diff --git a/test/MC/SystemZ/insn-bad-z196.s b/test/MC/SystemZ/insn-bad-z196.s new file mode 100644 index 0000000000..0124401caa --- /dev/null +++ b/test/MC/SystemZ/insn-bad-z196.s @@ -0,0 +1,44 @@ +# For z196 only. +# RUN: not llvm-mc -triple s390x-linux-gnu -mcpu=z196 < %s 2> %t +# RUN: FileCheck < %t %s +#CHECK: error: invalid operand +#CHECK: sllk %r0,%r0,-524289 +#CHECK: error: invalid operand +#CHECK: sllk %r0,%r0,524288 +#CHECK: error: %r0 used in an address +#CHECK: sllk %r0,%r0,0(%r0) +#CHECK: error: invalid use of indexed addressing +#CHECK: sllk %r0,%r0,0(%r1,%r2) + + sllk %r0,%r0,-524289 + sllk %r0,%r0,524288 + sllk %r0,%r0,0(%r0) + sllk %r0,%r0,0(%r1,%r2) + +#CHECK: error: invalid operand +#CHECK: srak %r0,%r0,-524289 +#CHECK: error: invalid operand +#CHECK: srak %r0,%r0,524288 +#CHECK: error: %r0 used in an address +#CHECK: srak %r0,%r0,0(%r0) +#CHECK: error: invalid use of indexed addressing +#CHECK: srak %r0,%r0,0(%r1,%r2) + + srak %r0,%r0,-524289 + srak %r0,%r0,524288 + srak %r0,%r0,0(%r0) + srak %r0,%r0,0(%r1,%r2) + +#CHECK: error: invalid operand +#CHECK: srlk %r0,%r0,-524289 +#CHECK: error: invalid operand +#CHECK: srlk %r0,%r0,524288 +#CHECK: error: %r0 used in an address +#CHECK: srlk %r0,%r0,0(%r0) +#CHECK: error: invalid use of indexed addressing +#CHECK: srlk %r0,%r0,0(%r1,%r2) + + srlk %r0,%r0,-524289 + srlk %r0,%r0,524288 + srlk %r0,%r0,0(%r0) + srlk %r0,%r0,0(%r1,%r2) diff --git a/test/MC/SystemZ/insn-bad.s b/test/MC/SystemZ/insn-bad.s index 60dc64f6da..7c0f23a367 100644 --- a/test/MC/SystemZ/insn-bad.s +++ b/test/MC/SystemZ/insn-bad.s @@ -1,4 +1,5 @@ -# RUN: not llvm-mc -triple s390x-linux-gnu < %s 2> %t +# For z10 only. +# RUN: not llvm-mc -triple s390x-linux-gnu -mcpu=z10 < %s 2> %t # RUN: FileCheck < %t %s #CHECK: error: invalid operand @@ -2343,6 +2344,11 @@ sllg %r0,%r0,0(%r0) sllg %r0,%r0,0(%r1,%r2) +#CHECK: error: {{(instruction requires: distinct-ops)?}} +#CHECK: sllk %r2,%r3,4(%r5) + + sllk %r2,%r3,4(%r5) + #CHECK: error: invalid operand #CHECK: sly %r0, -524289 #CHECK: error: invalid operand @@ -2403,6 +2409,11 @@ srag %r0,%r0,0(%r0) srag %r0,%r0,0(%r1,%r2) +#CHECK: error: {{(instruction requires: distinct-ops)?}} +#CHECK: srak %r2,%r3,4(%r5) + + srak %r2,%r3,4(%r5) + #CHECK: error: invalid operand #CHECK: srl %r0,-1 #CHECK: error: invalid operand @@ -2431,6 +2442,11 @@ srlg %r0,%r0,0(%r0) srlg %r0,%r0,0(%r1,%r2) +#CHECK: error: {{(instruction requires: distinct-ops)?}} +#CHECK: srlk %r2,%r3,4(%r5) + + srlk %r2,%r3,4(%r5) + #CHECK: error: invalid operand #CHECK: st %r0, -1 #CHECK: error: invalid operand diff --git a/test/MC/SystemZ/insn-good-z196.s b/test/MC/SystemZ/insn-good-z196.s new file mode 100644 index 0000000000..28de0ee158 --- /dev/null +++ b/test/MC/SystemZ/insn-good-z196.s @@ -0,0 +1,80 @@ +# For z196 and above. +# RUN: llvm-mc -triple s390x-linux-gnu -mcpu=z196 -show-encoding %s | FileCheck %s + +#CHECK: sllk %r0, %r0, 0 # encoding: [0xeb,0x00,0x00,0x00,0x00,0xdf] +#CHECK: sllk %r15, %r1, 0 # encoding: [0xeb,0xf1,0x00,0x00,0x00,0xdf] +#CHECK: sllk %r1, %r15, 0 # encoding: [0xeb,0x1f,0x00,0x00,0x00,0xdf] +#CHECK: sllk %r15, %r15, 0 # encoding: [0xeb,0xff,0x00,0x00,0x00,0xdf] +#CHECK: sllk %r0, %r0, -524288 # encoding: [0xeb,0x00,0x00,0x00,0x80,0xdf] +#CHECK: sllk %r0, %r0, -1 # encoding: [0xeb,0x00,0x0f,0xff,0xff,0xdf] +#CHECK: sllk %r0, %r0, 1 # encoding: [0xeb,0x00,0x00,0x01,0x00,0xdf] +#CHECK: sllk %r0, %r0, 524287 # encoding: [0xeb,0x00,0x0f,0xff,0x7f,0xdf] +#CHECK: sllk %r0, %r0, 0(%r1) # encoding: [0xeb,0x00,0x10,0x00,0x00,0xdf] +#CHECK: sllk %r0, %r0, 0(%r15) # encoding: [0xeb,0x00,0xf0,0x00,0x00,0xdf] +#CHECK: sllk %r0, %r0, 524287(%r1) # encoding: [0xeb,0x00,0x1f,0xff,0x7f,0xdf] +#CHECK: sllk %r0, %r0, 524287(%r15) # encoding: [0xeb,0x00,0xff,0xff,0x7f,0xdf] + + sllk %r0,%r0,0 + sllk %r15,%r1,0 + sllk %r1,%r15,0 + sllk %r15,%r15,0 + sllk %r0,%r0,-524288 + sllk %r0,%r0,-1 + sllk %r0,%r0,1 + sllk %r0,%r0,524287 + sllk %r0,%r0,0(%r1) + sllk %r0,%r0,0(%r15) + sllk %r0,%r0,524287(%r1) + sllk %r0,%r0,524287(%r15) + +#CHECK: srak %r0, %r0, 0 # encoding: [0xeb,0x00,0x00,0x00,0x00,0xdc] +#CHECK: srak %r15, %r1, 0 # encoding: [0xeb,0xf1,0x00,0x00,0x00,0xdc] +#CHECK: srak %r1, %r15, 0 # encoding: [0xeb,0x1f,0x00,0x00,0x00,0xdc] +#CHECK: srak %r15, %r15, 0 # encoding: [0xeb,0xff,0x00,0x00,0x00,0xdc] +#CHECK: srak %r0, %r0, -524288 # encoding: [0xeb,0x00,0x00,0x00,0x80,0xdc] +#CHECK: srak %r0, %r0, -1 # encoding: [0xeb,0x00,0x0f,0xff,0xff,0xdc] +#CHECK: srak %r0, %r0, 1 # encoding: [0xeb,0x00,0x00,0x01,0x00,0xdc] +#CHECK: srak %r0, %r0, 524287 # encoding: [0xeb,0x00,0x0f,0xff,0x7f,0xdc] +#CHECK: srak %r0, %r0, 0(%r1) # encoding: [0xeb,0x00,0x10,0x00,0x00,0xdc] +#CHECK: srak %r0, %r0, 0(%r15) # encoding: [0xeb,0x00,0xf0,0x00,0x00,0xdc] +#CHECK: srak %r0, %r0, 524287(%r1) # encoding: [0xeb,0x00,0x1f,0xff,0x7f,0xdc] +#CHECK: srak %r0, %r0, 524287(%r15) # encoding: [0xeb,0x00,0xff,0xff,0x7f,0xdc] + + srak %r0,%r0,0 + srak %r15,%r1,0 + srak %r1,%r15,0 + srak %r15,%r15,0 + srak %r0,%r0,-524288 + srak %r0,%r0,-1 + srak %r0,%r0,1 + srak %r0,%r0,524287 + srak %r0,%r0,0(%r1) + srak %r0,%r0,0(%r15) + srak %r0,%r0,524287(%r1) + srak %r0,%r0,524287(%r15) + +#CHECK: srlk %r0, %r0, 0 # encoding: [0xeb,0x00,0x00,0x00,0x00,0xde] +#CHECK: srlk %r15, %r1, 0 # encoding: [0xeb,0xf1,0x00,0x00,0x00,0xde] +#CHECK: srlk %r1, %r15, 0 # encoding: [0xeb,0x1f,0x00,0x00,0x00,0xde] +#CHECK: srlk %r15, %r15, 0 # encoding: [0xeb,0xff,0x00,0x00,0x00,0xde] +#CHECK: srlk %r0, %r0, -524288 # encoding: [0xeb,0x00,0x00,0x00,0x80,0xde] +#CHECK: srlk %r0, %r0, -1 # encoding: [0xeb,0x00,0x0f,0xff,0xff,0xde] +#CHECK: srlk %r0, %r0, 1 # encoding: [0xeb,0x00,0x00,0x01,0x00,0xde] +#CHECK: srlk %r0, %r0, 524287 # encoding: [0xeb,0x00,0x0f,0xff,0x7f,0xde] +#CHECK: srlk %r0, %r0, 0(%r1) # encoding: [0xeb,0x00,0x10,0x00,0x00,0xde] +#CHECK: srlk %r0, %r0, 0(%r15) # encoding: [0xeb,0x00,0xf0,0x00,0x00,0xde] +#CHECK: srlk %r0, %r0, 524287(%r1) # encoding: [0xeb,0x00,0x1f,0xff,0x7f,0xde] +#CHECK: srlk %r0, %r0, 524287(%r15) # encoding: [0xeb,0x00,0xff,0xff,0x7f,0xde] + + srlk %r0,%r0,0 + srlk %r15,%r1,0 + srlk %r1,%r15,0 + srlk %r15,%r15,0 + srlk %r0,%r0,-524288 + srlk %r0,%r0,-1 + srlk %r0,%r0,1 + srlk %r0,%r0,524287 + srlk %r0,%r0,0(%r1) + srlk %r0,%r0,0(%r15) + srlk %r0,%r0,524287(%r1) + srlk %r0,%r0,524287(%r15) diff --git a/test/MC/SystemZ/insn-good.s b/test/MC/SystemZ/insn-good.s index e9ab1ef8e3..874c1c6d0e 100644 --- a/test/MC/SystemZ/insn-good.s +++ b/test/MC/SystemZ/insn-good.s @@ -1,3 +1,4 @@ +# For z10 and above. # RUN: llvm-mc -triple s390x-linux-gnu -show-encoding %s | FileCheck %s #CHECK: a %r0, 0 # encoding: [0x5a,0x00,0x00,0x00] -- cgit v1.2.3