[clang] 46846ac - [Matrix] Add inline assembly test case.
Florian Hahn via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 17 07:13:36 PST 2020
Author: Florian Hahn
Date: 2020-11-17T15:13:16Z
New Revision: 46846ac45b2c44aa6e33be5ac498309f465ba7eb
URL: https://github.com/llvm/llvm-project/commit/46846ac45b2c44aa6e33be5ac498309f465ba7eb
DIFF: https://github.com/llvm/llvm-project/commit/46846ac45b2c44aa6e33be5ac498309f465ba7eb.diff
LOG: [Matrix] Add inline assembly test case.
This patch adds a new test cases which uses a matrix value as memory
inline assembly argument. Currently the pointer element type does not
match the vector type.
Added:
Modified:
clang/test/CodeGen/matrix-type.c
Removed:
################################################################################
diff --git a/clang/test/CodeGen/matrix-type.c b/clang/test/CodeGen/matrix-type.c
index 31d2497b7986..399984b50c69 100644
--- a/clang/test/CodeGen/matrix-type.c
+++ b/clang/test/CodeGen/matrix-type.c
@@ -156,3 +156,21 @@ void matrix_struct(Matrix *a, Matrix *b) {
// CHECK-NEXT: ret void
b->Data = a->Data;
}
+
+typedef double dx4x4_t __attribute__((matrix_type(4, 4)));
+void matrix_inline_asm_memory_readwrite() {
+ // CHECK-LABEL: define void @matrix_inline_asm_memory_readwrite()
+ // CHECK-NEXT: entry:
+ // CHECK-NEXT: [[ALLOCA:%.+]] = alloca [16 x double], align 8
+ // CHECK-NEXT: [[PTR:%.+]] = bitcast [16 x double]* [[ALLOCA]] to <16 x double>*
+ // CHECK-NEXT: [[VAL:%.+]] = load <16 x double>, <16 x double>* [[PTR]], align 8
+ // FIXME: Pointer element type does not match the vector type.
+ // CHECK-NEXT: call void asm sideeffect "", "=*r|m,0,~{memory},~{dirflag},~{fpsr},~{flags}"([16 x double]* [[ALLOCA]], <16 x double> [[VAL]])
+ // CHECK-NEXT: ret void
+
+ dx4x4_t m;
+ asm volatile(""
+ : "+r,m"(m)
+ :
+ : "memory");
+}
More information about the cfe-commits
mailing list