1 // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -O2 -emit-llvm -o - %s | FileCheck %s
3 _Bool
test_wc_i1(_Bool b1
, _Bool b2
) {
5 asm("crand %0, %1, %2" : "=wc"(o
) : "wc"(b1
), "wc"(b2
) : );
7 // CHECK-LABEL: define{{.*}} zeroext i1 @test_wc_i1(i1 noundef zeroext %b1, i1 noundef zeroext %b2)
8 // CHECK: call i8 asm "crand $0, $1, $2", "=^wc,^wc,^wc"(i1 %b1, i1 %b2)
11 int test_wc_i32(int b1
, int b2
) {
13 asm("crand %0, %1, %2" : "=wc"(o
) : "wc"(b1
), "wc"(b2
) : );
15 // CHECK-LABEL: signext i32 @test_wc_i32(i32 noundef signext %b1, i32 noundef signext %b2)
16 // CHECK: call i32 asm "crand $0, $1, $2", "=^wc,^wc,^wc"(i32 %b1, i32 %b2)
19 unsigned char test_wc_i8(unsigned char b1
, unsigned char b2
) {
21 asm("crand %0, %1, %2" : "=wc"(o
) : "wc"(b1
), "wc"(b2
) : );
23 // CHECK-LABEL: zeroext i8 @test_wc_i8(i8 noundef zeroext %b1, i8 noundef zeroext %b2)
24 // CHECK: call i8 asm "crand $0, $1, $2", "=^wc,^wc,^wc"(i8 %b1, i8 %b2)
27 float test_fmaxf(float x
, float y
) {
28 asm("xsmaxdp %x0, %x1, %x2" : "=ww"(x
) : "ww"(x
), "ww"(y
));
30 // CHECK-LABEL: float @test_fmaxf(float noundef %x, float noundef %y)
31 // CHECK: call float asm "xsmaxdp ${0:x}, ${1:x}, ${2:x}", "=^ww,^ww,^ww"(float %x, float %y)
34 double test_fmax(double x
, double y
) {
35 asm("xsmaxdp %x0, %x1, %x2" : "=ws"(x
) : "ws"(x
), "ws"(y
));
37 // CHECK-LABEL: double @test_fmax(double noundef %x, double noundef %y)
38 // CHECK: call double asm "xsmaxdp ${0:x}, ${1:x}, ${2:x}", "=^ws,^ws,^ws"(double %x, double %y)
41 void testZ(void *addr
) {
42 asm volatile ("dcbz %y0\n" :: "Z"(*(unsigned char *)addr
) : "memory");
43 // CHECK-LABEL: void @testZ(ptr noundef %addr)
44 // CHECK: call void asm sideeffect "dcbz ${0:y}\0A", "*Z,~{memory}"(ptr elementtype(i8) %addr)
47 void testZwOff(void *addr
, long long off
) {
48 asm volatile ("dcbz %y0\n" :: "Z"(*(unsigned char *)(addr
+ off
)) : "memory");
49 // CHECK-LABEL: void @testZwOff(ptr noundef %addr, i64 noundef %off)
50 // CHECK: %[[VAL:[^ ]+]] = getelementptr i8, ptr %addr, i64 %off
51 // CHECK: call void asm sideeffect "dcbz ${0:y}\0A", "*Z,~{memory}"(ptr elementtype(i8) %[[VAL]])