rogfer01 created this revision.
rogfer01 added a reviewer: rsmith.
rogfer01 added a subscriber: cfe-commits.
Herald added a subscriber: aemerson.

RAS extensions are part of ARMv8.2.

This patch enables +ras +noras to AArch64 in clang.

http://reviews.llvm.org/D20283

Files:
  lib/Driver/Tools.cpp
  test/Driver/aarch64-ras.c
  test/Driver/arm-ras.c

Index: test/Driver/arm-ras.c
===================================================================
--- /dev/null
+++ test/Driver/arm-ras.c
@@ -0,0 +1,7 @@
+// RUN: %clang -target arm-none-none-eabi -march=armv8a+ras -### -c %s 2>&1 | 
FileCheck --check-prefix=CHECK-RAS %s
+// RUN: %clang -target arm-none-none-eabi -mcpu=generic+ras -### -c %s 2>&1 | 
FileCheck --check-prefix=CHECK-RAS %s
+// CHECK-RAS: "-target-feature" "+rasext"
+
+// RUN: %clang -target arm-none-none-eabi -march=armv8a+noras -### -c %s 2>&1 
| FileCheck --check-prefix=CHECK-NORAS %s
+// RUN: %clang -target arm-none-none-eabi -mcpu=generic+noras -### -c %s 2>&1 
| FileCheck --check-prefix=CHECK-NORAS %s
+// CHECK-NORAS: "-target-feature" "-rasext"
Index: test/Driver/aarch64-ras.c
===================================================================
--- /dev/null
+++ test/Driver/aarch64-ras.c
@@ -0,0 +1,7 @@
+// RUN: %clang -target aarch64-none-none-eabi -march=armv8a+ras -### -c %s 
2>&1 | FileCheck --check-prefix=CHECK-RAS %s
+// RUN: %clang -target aarch64-none-none-eabi -mcpu=generic+ras -### -c %s 
2>&1 | FileCheck --check-prefix=CHECK-RAS %s
+// CHECK-RAS: "-target-feature" "+ras"
+
+// RUN: %clang -target aarch64-none-none-eabi -march=armv8a+noras -### -c %s 
2>&1 | FileCheck --check-prefix=CHECK-NORAS %s
+// RUN: %clang -target aarch64-none-none-eabi -mcpu=generic+noras -### -c %s 
2>&1 | FileCheck --check-prefix=CHECK-NORAS %s
+// CHECK-NORAS: "-target-feature" "-ras"
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -2223,12 +2223,14 @@
                              .Case("crypto", "+crypto")
                              .Case("fp16", "+fullfp16")
                              .Case("profile", "+spe")
+                             .Case("ras", "+ras")
                              .Case("nofp", "-fp-armv8")
                              .Case("nosimd", "-neon")
                              .Case("nocrc", "-crc")
                              .Case("nocrypto", "-crypto")
                              .Case("nofp16", "-fullfp16")
                              .Case("noprofile", "-spe")
+                             .Case("noras", "-ras")
                              .Default(nullptr);
     if (result)
       Features.push_back(result);


Index: test/Driver/arm-ras.c
===================================================================
--- /dev/null
+++ test/Driver/arm-ras.c
@@ -0,0 +1,7 @@
+// RUN: %clang -target arm-none-none-eabi -march=armv8a+ras -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RAS %s
+// RUN: %clang -target arm-none-none-eabi -mcpu=generic+ras -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RAS %s
+// CHECK-RAS: "-target-feature" "+rasext"
+
+// RUN: %clang -target arm-none-none-eabi -march=armv8a+noras -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-NORAS %s
+// RUN: %clang -target arm-none-none-eabi -mcpu=generic+noras -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-NORAS %s
+// CHECK-NORAS: "-target-feature" "-rasext"
Index: test/Driver/aarch64-ras.c
===================================================================
--- /dev/null
+++ test/Driver/aarch64-ras.c
@@ -0,0 +1,7 @@
+// RUN: %clang -target aarch64-none-none-eabi -march=armv8a+ras -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RAS %s
+// RUN: %clang -target aarch64-none-none-eabi -mcpu=generic+ras -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RAS %s
+// CHECK-RAS: "-target-feature" "+ras"
+
+// RUN: %clang -target aarch64-none-none-eabi -march=armv8a+noras -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-NORAS %s
+// RUN: %clang -target aarch64-none-none-eabi -mcpu=generic+noras -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-NORAS %s
+// CHECK-NORAS: "-target-feature" "-ras"
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -2223,12 +2223,14 @@
                              .Case("crypto", "+crypto")
                              .Case("fp16", "+fullfp16")
                              .Case("profile", "+spe")
+                             .Case("ras", "+ras")
                              .Case("nofp", "-fp-armv8")
                              .Case("nosimd", "-neon")
                              .Case("nocrc", "-crc")
                              .Case("nocrypto", "-crypto")
                              .Case("nofp16", "-fullfp16")
                              .Case("noprofile", "-spe")
+                             .Case("noras", "-ras")
                              .Default(nullptr);
     if (result)
       Features.push_back(result);
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to