2016-05-18 22:56:14 +08:00
|
|
|
// RUN: %clang_cc1 -triple hexagon-unknown-elf -target-feature +hvx -emit-llvm -o - %s | FileCheck %s
|
|
|
|
|
|
|
|
typedef int v64 __attribute__((__vector_size__(64)))
|
|
|
|
__attribute__((aligned(64)));
|
|
|
|
|
2016-05-20 21:50:32 +08:00
|
|
|
int g;
|
|
|
|
|
2016-05-18 22:56:14 +08:00
|
|
|
void foo(v64 v0, v64 v1, v64 *p) {
|
2016-05-20 21:50:32 +08:00
|
|
|
int r;
|
2016-05-18 22:56:14 +08:00
|
|
|
v64 q0;
|
|
|
|
asm ("%0 = vgtw(%1.w,%2.w)" : "=q"(q0) : "v"(v0), "v"(v1));
|
|
|
|
// CHECK: call <16 x i32> asm "$0 = vgtw($1.w,$2.w)", "=q,v,v"(<16 x i32>{{.*}}, <16 x i32>{{.*}})
|
|
|
|
*p = q0;
|
2016-05-20 21:50:32 +08:00
|
|
|
|
|
|
|
asm ("%0 = memw(##%1)" : "=r"(r) : "s"(&g));
|
|
|
|
// CHECK: call i32 asm "$0 = memw(##$1)", "=r,s"(i32* @g)
|
2016-05-18 22:56:14 +08:00
|
|
|
}
|
2017-07-22 02:07:15 +08:00
|
|
|
|
|
|
|
void fred(unsigned *p, unsigned m, unsigned v) {
|
|
|
|
asm ("memw(%0++%1) = %2" : : "r"(p),"a"(m),"r"(v) : "memory");
|
2017-07-22 05:23:05 +08:00
|
|
|
// CHECK: call void asm sideeffect "memw($0++$1) = $2", "r,a,r,~{memory}"(i32* %{{.*}}, i32 %{{.*}}, i32 %{{.*}})
|
2017-07-22 02:07:15 +08:00
|
|
|
}
|
|
|
|
|