FreeBSD: add file descriptor tracking for _umtx_op
[valgrind.git] / none / tests / s390x / bfp-3.c
blob857e1c83ff8c47563f0969a5f292ce638603d58c
1 #include <stdio.h>
3 /* Test BFP multiply and add/sub 32/64-bit. There are no such insns
4 working with 128-bit data */
6 void maebr(float v1, float v2, float v3)
8 float r1 = v1;
10 __asm__ volatile("maebr %[r1],%[r3],%[r2]"
11 : [r1]"+f"(r1) : [r2]"f"(v2), [r3]"f"(v3));
12 printf("maebr %f * %f + %f -> %f\n", v2, v3, v1, r1);
15 void madbr(double v1, double v2, double v3)
17 double r1 = v1;
19 __asm__ volatile("madbr %[r1],%[r3],%[r2]"
20 : [r1]"+f"(r1) : [r2]"f"(v2), [r3]"f"(v3));
21 printf("madbr %f * %f + %f -> %f\n", v2, v3, v1, r1);
24 void msebr(float v1, float v2, float v3)
26 float r1 = v1;
28 __asm__ volatile("msebr %[r1],%[r3],%[r2]"
29 : [r1]"+f"(r1) : [r2]"f"(v2), [r3]"f"(v3));
30 printf("msebr %f * %f - %f -> %f\n", v2, v3, v1, r1);
33 void msdbr(double v1, double v2, double v3)
35 double r1 = v1;
37 __asm__ volatile("msdbr %[r1],%[r3],%[r2]"
38 : [r1]"+f"(r1) : [r2]"f"(v2), [r3]"f"(v3));
39 printf("msdbr %f * %f - %f -> %f\n", v2, v3, v1, r1);
42 int main(void)
44 // multiply and add
45 maebr(10.5f, 20.25, 3.0); // 4 byte values
46 madbr(-10.5, 42.75, -2.0); // 8 byte values
48 // multiply and sub
49 msebr(10.5f, 20.25, 3.0); // 4 byte values
50 msdbr(-10.5, 42.75, -2.0); // 8 byte values
52 return 0;