brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 005bf5c Raw
53 lines · c
1// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -O2 -emit-llvm -o - %s | FileCheck %s2 3_Bool test_wc_i1(_Bool b1, _Bool b2) {4  _Bool o;5  asm("crand %0, %1, %2" : "=wc"(o) : "wc"(b1), "wc"(b2) : );6  return o;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)9}10 11int test_wc_i32(int b1, int b2) {12  int o;13  asm("crand %0, %1, %2" : "=wc"(o) : "wc"(b1), "wc"(b2) : );14  return o;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)17}18 19unsigned char test_wc_i8(unsigned char b1, unsigned char b2) {20  unsigned char o;21  asm("crand %0, %1, %2" : "=wc"(o) : "wc"(b1), "wc"(b2) : );22  return o;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)25}26 27float test_fmaxf(float x, float y) {28  asm("xsmaxdp %x0, %x1, %x2" : "=ww"(x) : "ww"(x), "ww"(y));29  return x;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)32}33 34double test_fmax(double x, double y) {35  asm("xsmaxdp %x0, %x1, %x2" : "=ws"(x) : "ws"(x), "ws"(y));36  return x;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)39}40 41void 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)45}46 47void 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 inbounds i8, ptr %addr, i64 %off51// CHECK: call void asm sideeffect "dcbz ${0:y}\0A", "*Z,~{memory}"(ptr elementtype(i8) %[[VAL]])52}53