1 /* Test generation of DFP instructions for POWER6. */
2 /* Origin: Janis Johnson <janis187@us.ibm.com> */
3 /* { dg-do compile { target { powerpc*-*-linux* } } } */
4 /* { dg-require-effective-target hard_dfp } */
5 /* { dg-options "-std=gnu99 -mdejagnu-cpu=power6" } */
6
7 /* { dg-final { scan-assembler "daddq" } } */
8 /* { dg-final { scan-assembler "ddivq" } } */
9 /* { dg-final { scan-assembler "dmulq" } } */
10 /* { dg-final { scan-assembler "dsubq" } } */
11 /* { dg-final { scan-assembler-times "dcmpuq" 6 } } */
12 /* { dg-final { scan-assembler-times "dctfixq" 2 } } */
13 /* { dg-final { scan-assembler-times "drintnq" 2 } } */
14 /* { dg-final { scan-assembler-times "dcffixq" 2 } } */
15
16 extern _Decimal128 a, b, c;
17 extern int result;
18 extern int si;
19 extern long long di;
20
add(void)21 void add (void) { a = b + c; }
div(void)22 void div (void) { a = b / c; }
mul(void)23 void mul (void) { a = b * c; }
sub(void)24 void sub (void) { a = b - c; }
eq(void)25 void eq (void) { result = a == b; }
ne(void)26 void ne (void) { result = a != b; }
lt(void)27 void lt (void) { result = a < b; }
le(void)28 void le (void) { result = a <= b; }
gt(void)29 void gt (void) { result = a > b; }
ge(void)30 void ge (void) { result = a >= b; }
tdsi(void)31 void tdsi (void) { si = a; }
tddi(void)32 void tddi (void) { di = a; }
sitd(void)33 void sitd (void) { a = si; }
ditd(void)34 void ditd (void) { a = di; }
35