From 81ea345894636edc6dc016b6b93ecb7d259b4ae6 Mon Sep 17 00:00:00 2001 From: Kevin Qin Date: Wed, 23 Apr 2014 06:22:48 +0000 Subject: [ARM64] Enable feature predicates for NEON / FP / CRYPTO. AArch64 has feature predicates for NEON, FP and CRYPTO instructions. This allows the compiler to generate code without using FP, NEON or CRYPTO instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206949 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/ARM64/complex-copy-noneon.ll | 21 +++++++++++++++++++++ test/CodeGen/ARM64/crypto.ll | 2 +- test/CodeGen/ARM64/reg-copy-noneon.ll | 20 ++++++++++++++++++++ test/MC/ARM64/advsimd.s | 2 +- test/MC/ARM64/aliases.s | 2 +- test/MC/ARM64/arithmetic-encoding.s | 2 +- test/MC/ARM64/crypto.s | 2 +- test/MC/ARM64/diagno-predicate.s | 19 +++++++++++++++++++ test/MC/ARM64/fp-encoding.s | 2 +- test/MC/ARM64/nv-cond.s | 2 +- test/MC/ARM64/simd-ldst.s | 2 +- test/MC/ARM64/vector-lists.s | 2 +- test/MC/ARM64/verbose-vector-case.s | 2 +- test/MC/Disassembler/ARM64/advsimd.txt | 2 +- test/MC/Disassembler/ARM64/canonical-form.txt | 2 +- test/MC/Disassembler/ARM64/crypto.txt | 4 ++-- test/MC/Disassembler/ARM64/non-apple-fmov.txt | 2 +- test/MC/Disassembler/ARM64/scalar-fp.txt | 2 +- 18 files changed, 76 insertions(+), 16 deletions(-) create mode 100644 test/CodeGen/ARM64/complex-copy-noneon.ll create mode 100644 test/CodeGen/ARM64/reg-copy-noneon.ll create mode 100644 test/MC/ARM64/diagno-predicate.s (limited to 'test') diff --git a/test/CodeGen/ARM64/complex-copy-noneon.ll b/test/CodeGen/ARM64/complex-copy-noneon.ll new file mode 100644 index 0000000000..f65b116128 --- /dev/null +++ b/test/CodeGen/ARM64/complex-copy-noneon.ll @@ -0,0 +1,21 @@ +; RUN: llc -mtriple=arm64-none-linux-gnu -mattr=-neon < %s + +; The DAG combiner decided to use a vector load/store for this struct copy +; previously. This probably shouldn't happen without NEON, but the most +; important thing is that it compiles. + +define void @store_combine() nounwind { + %src = alloca { double, double }, align 8 + %dst = alloca { double, double }, align 8 + + %src.realp = getelementptr inbounds { double, double }* %src, i32 0, i32 0 + %src.real = load double* %src.realp + %src.imagp = getelementptr inbounds { double, double }* %src, i32 0, i32 1 + %src.imag = load double* %src.imagp + + %dst.realp = getelementptr inbounds { double, double }* %dst, i32 0, i32 0 + %dst.imagp = getelementptr inbounds { double, double }* %dst, i32 0, i32 1 + store double %src.real, double* %dst.realp + store double %src.imag, double* %dst.imagp + ret void +} diff --git a/test/CodeGen/ARM64/crypto.ll b/test/CodeGen/ARM64/crypto.ll index 3804310287..0020865bcd 100644 --- a/test/CodeGen/ARM64/crypto.ll +++ b/test/CodeGen/ARM64/crypto.ll @@ -1,4 +1,4 @@ -; RUN: llc -march=arm64 -arm64-neon-syntax=apple -o - %s | FileCheck %s +; RUN: llc -march=arm64 -mattr=crypto -arm64-neon-syntax=apple -o - %s | FileCheck %s declare <16 x i8> @llvm.arm64.crypto.aese(<16 x i8> %data, <16 x i8> %key) declare <16 x i8> @llvm.arm64.crypto.aesd(<16 x i8> %data, <16 x i8> %key) diff --git a/test/CodeGen/ARM64/reg-copy-noneon.ll b/test/CodeGen/ARM64/reg-copy-noneon.ll new file mode 100644 index 0000000000..29255ef187 --- /dev/null +++ b/test/CodeGen/ARM64/reg-copy-noneon.ll @@ -0,0 +1,20 @@ +; RUN: llc -mtriple=arm64-none-linux-gnu -mattr=-neon < %s | FileCheck %s + +define float @copy_FPR32(float %a, float %b) { +;CHECK-LABEL: copy_FPR32: +;CHECK: fmov s0, s1 + ret float %b; +} + +define double @copy_FPR64(double %a, double %b) { +;CHECK-LABEL: copy_FPR64: +;CHECK: fmov d0, d1 + ret double %b; +} + +define fp128 @copy_FPR128(fp128 %a, fp128 %b) { +;CHECK-LABEL: copy_FPR128: +;CHECK: str q1, [sp, #-16]! +;CHECK-NEXT: ldr q0, [sp, #16]! + ret fp128 %b; +} diff --git a/test/MC/ARM64/advsimd.s b/test/MC/ARM64/advsimd.s index fce0832f12..bd1924e4cd 100644 --- a/test/MC/ARM64/advsimd.s +++ b/test/MC/ARM64/advsimd.s @@ -1,4 +1,4 @@ -; RUN: llvm-mc -triple arm64-apple-darwin -output-asm-variant=1 -show-encoding < %s | FileCheck %s +; RUN: llvm-mc -triple arm64-apple-darwin -mattr=crypto -output-asm-variant=1 -show-encoding < %s | FileCheck %s foo: diff --git a/test/MC/ARM64/aliases.s b/test/MC/ARM64/aliases.s index 4fe4b93d4f..262149de3e 100644 --- a/test/MC/ARM64/aliases.s +++ b/test/MC/ARM64/aliases.s @@ -1,4 +1,4 @@ -; RUN: llvm-mc -triple arm64-apple-darwin -output-asm-variant=1 -show-encoding < %s | FileCheck %s +; RUN: llvm-mc -triple arm64-apple-darwin -mattr=neon -output-asm-variant=1 -show-encoding < %s | FileCheck %s foo: ;----------------------------------------------------------------------------- diff --git a/test/MC/ARM64/arithmetic-encoding.s b/test/MC/ARM64/arithmetic-encoding.s index 6d28bce5a8..2193feb3f6 100644 --- a/test/MC/ARM64/arithmetic-encoding.s +++ b/test/MC/ARM64/arithmetic-encoding.s @@ -1,4 +1,4 @@ -; RUN: llvm-mc -triple arm64-apple-darwin -show-encoding < %s | FileCheck %s +; RUN: llvm-mc -triple arm64-apple-darwin -mattr=neon -show-encoding < %s | FileCheck %s foo: ;==---------------------------------------------------------------------------== diff --git a/test/MC/ARM64/crypto.s b/test/MC/ARM64/crypto.s index d7c4ec3df4..51efd2132a 100644 --- a/test/MC/ARM64/crypto.s +++ b/test/MC/ARM64/crypto.s @@ -1,4 +1,4 @@ -; RUN: llvm-mc -triple arm64-apple-darwin -show-encoding -output-asm-variant=1 < %s | FileCheck %s +; RUN: llvm-mc -triple arm64-apple-darwin -mattr=crypto -show-encoding -output-asm-variant=1 < %s | FileCheck %s foo: aese.16b v0, v1 diff --git a/test/MC/ARM64/diagno-predicate.s b/test/MC/ARM64/diagno-predicate.s new file mode 100644 index 0000000000..399a85c631 --- /dev/null +++ b/test/MC/ARM64/diagno-predicate.s @@ -0,0 +1,19 @@ +// RUN: not llvm-mc -triple arm64-linux-gnu -mattr=-fp-armv8 < %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-ERROR < %t %s + + + fcvt d0, s0 +// CHECK-ERROR: error: instruction requires: fp-armv8 +// CHECK-ERROR-NEXT: fcvt d0, s0 +// CHECK-ERROR-NEXT: ^ + + fmla v9.2s, v9.2s, v0.2s +// CHECK-ERROR: error: instruction requires: neon +// CHECK-ERROR-NEXT: fmla v9.2s, v9.2s, v0.2s +// CHECK-ERROR-NEXT: ^ + + pmull v0.1q, v1.1d, v2.1d +// CHECK-ERROR: error: instruction requires: crypto +// CHECK-ERROR-NEXT: pmull v0.1q, v1.1d, v2.1d +// CHECK-ERROR-NEXT: ^ + diff --git a/test/MC/ARM64/fp-encoding.s b/test/MC/ARM64/fp-encoding.s index 7c7208f770..08a7b6f027 100644 --- a/test/MC/ARM64/fp-encoding.s +++ b/test/MC/ARM64/fp-encoding.s @@ -1,4 +1,4 @@ -; RUN: llvm-mc -triple arm64-apple-darwin -show-encoding -output-asm-variant=1 < %s | FileCheck %s +; RUN: llvm-mc -triple arm64-apple-darwin -mattr=neon -show-encoding -output-asm-variant=1 < %s | FileCheck %s foo: ;----------------------------------------------------------------------------- diff --git a/test/MC/ARM64/nv-cond.s b/test/MC/ARM64/nv-cond.s index ded5ec6ad9..1b4d054d24 100644 --- a/test/MC/ARM64/nv-cond.s +++ b/test/MC/ARM64/nv-cond.s @@ -1,4 +1,4 @@ -// RUN: llvm-mc < %s -triple arm64 -show-encoding | FileCheck %s +// RUN: llvm-mc < %s -triple arm64 -mattr=neon -show-encoding | FileCheck %s fcsel d28,d31,d31,nv csel x0,x0,x0,nv diff --git a/test/MC/ARM64/simd-ldst.s b/test/MC/ARM64/simd-ldst.s index 75d038307e..30854852c2 100644 --- a/test/MC/ARM64/simd-ldst.s +++ b/test/MC/ARM64/simd-ldst.s @@ -1,4 +1,4 @@ -; RUN: llvm-mc -triple arm64-apple-darwin -output-asm-variant=1 -show-encoding < %s | FileCheck %s +; RUN: llvm-mc -triple arm64-apple-darwin -mattr=neon -output-asm-variant=1 -show-encoding < %s | FileCheck %s _ld1st1_multiple: ld1.8b {v0}, [x1] diff --git a/test/MC/ARM64/vector-lists.s b/test/MC/ARM64/vector-lists.s index e4cef610d7..0d02602237 100644 --- a/test/MC/ARM64/vector-lists.s +++ b/test/MC/ARM64/vector-lists.s @@ -1,4 +1,4 @@ -// RUN: not llvm-mc -triple arm64 -show-encoding < %s 2>%t | FileCheck %s +// RUN: not llvm-mc -triple arm64 -mattr=neon -show-encoding < %s 2>%t | FileCheck %s // RUN: FileCheck --check-prefix=CHECK-ERRORS < %t %s ST4 {v0.8B-v3.8B}, [x0] diff --git a/test/MC/ARM64/verbose-vector-case.s b/test/MC/ARM64/verbose-vector-case.s index bd363805bb..6f0a3812dd 100644 --- a/test/MC/ARM64/verbose-vector-case.s +++ b/test/MC/ARM64/verbose-vector-case.s @@ -1,4 +1,4 @@ -// RUN: llvm-mc -triple arm64 -show-encoding < %s | FileCheck %s +// RUN: llvm-mc -triple arm64 -mattr=crypto -show-encoding < %s | FileCheck %s pmull v8.8h, v8.8b, v8.8b pmull2 v8.8h, v8.16b, v8.16b diff --git a/test/MC/Disassembler/ARM64/advsimd.txt b/test/MC/Disassembler/ARM64/advsimd.txt index a943aecdc1..f9bfc8859c 100644 --- a/test/MC/Disassembler/ARM64/advsimd.txt +++ b/test/MC/Disassembler/ARM64/advsimd.txt @@ -1,4 +1,4 @@ -# RUN: llvm-mc -triple arm64-apple-darwin -output-asm-variant=1 --disassemble < %s | FileCheck %s +# RUN: llvm-mc -triple arm64-apple-darwin -mattr=crypto -output-asm-variant=1 --disassemble < %s | FileCheck %s 0x00 0xb8 0x20 0x0e 0x00 0xb8 0x20 0x4e diff --git a/test/MC/Disassembler/ARM64/canonical-form.txt b/test/MC/Disassembler/ARM64/canonical-form.txt index 09467a3184..1c94b13b4a 100644 --- a/test/MC/Disassembler/ARM64/canonical-form.txt +++ b/test/MC/Disassembler/ARM64/canonical-form.txt @@ -1,4 +1,4 @@ -# RUN: llvm-mc -triple arm64-apple-darwin --disassemble < %s | FileCheck %s +# RUN: llvm-mc -triple arm64-apple-darwin -mattr=neon --disassemble < %s | FileCheck %s 0x00 0x08 0x00 0xc8 diff --git a/test/MC/Disassembler/ARM64/crypto.txt b/test/MC/Disassembler/ARM64/crypto.txt index e163b2cd59..b905b92c63 100644 --- a/test/MC/Disassembler/ARM64/crypto.txt +++ b/test/MC/Disassembler/ARM64/crypto.txt @@ -1,5 +1,5 @@ -# RUN: llvm-mc -triple arm64-apple-darwin --disassemble < %s | FileCheck %s -# RUN: llvm-mc -triple arm64-apple-darwin -output-asm-variant=1 --disassemble < %s | FileCheck %s --check-prefix=CHECK-APPLE +# RUN: llvm-mc -triple arm64-apple-darwin -mattr=crypto --disassemble < %s | FileCheck %s +# RUN: llvm-mc -triple arm64-apple-darwin -mattr=crypto -output-asm-variant=1 --disassemble < %s | FileCheck %s --check-prefix=CHECK-APPLE 0x20 0x48 0x28 0x4e 0x20 0x58 0x28 0x4e diff --git a/test/MC/Disassembler/ARM64/non-apple-fmov.txt b/test/MC/Disassembler/ARM64/non-apple-fmov.txt index e3c3a996c4..75cb95ce18 100644 --- a/test/MC/Disassembler/ARM64/non-apple-fmov.txt +++ b/test/MC/Disassembler/ARM64/non-apple-fmov.txt @@ -1,4 +1,4 @@ -# RUN: llvm-mc -triple arm64 -disassemble < %s | FileCheck %s +# RUN: llvm-mc -triple arm64 -mattr=neon -disassemble < %s | FileCheck %s 0x00 0x00 0xae 0x9e 0x00 0x00 0xaf 0x9e diff --git a/test/MC/Disassembler/ARM64/scalar-fp.txt b/test/MC/Disassembler/ARM64/scalar-fp.txt index 732e1c12d2..1f76dee64d 100644 --- a/test/MC/Disassembler/ARM64/scalar-fp.txt +++ b/test/MC/Disassembler/ARM64/scalar-fp.txt @@ -1,4 +1,4 @@ -# RUN: llvm-mc -triple arm64-apple-darwin --disassemble -output-asm-variant=1 < %s | FileCheck %s +# RUN: llvm-mc -triple arm64-apple-darwin -mattr=neon --disassemble -output-asm-variant=1 < %s | FileCheck %s #----------------------------------------------------------------------------- # Floating-point arithmetic -- cgit v1.2.3