Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / mips-madd4.c
blobbc7bb593f95d6925ace973b314201516ad3e96d4
1 // REQUIRES: mips-registered-target
2 // RUN: %clang --target=mips64-unknown-linux -S -mmadd4 %s -o -| FileCheck %s -check-prefix=MADD4
3 // RUN: %clang --target=mips64-unknown-linux -S -mno-madd4 %s -o -| FileCheck %s -check-prefix=NOMADD4
4 // RUN: %clang --target=mips64-unknown-linux -S -mmadd4 -fno-honor-nans %s -o -| FileCheck %s -check-prefix=MADD4-NONAN
5 // RUN: %clang --target=mips64-unknown-linux -S -mno-madd4 -fno-honor-nans %s -o -| FileCheck %s -check-prefix=NOMADD4-NONAN
7 float madd_s (float f, float g, float h)
9 return (f * g) + h;
11 // MADD4: madd.s
12 // NOMADD4: mul.s
13 // NOMADD4: add.s
15 float msub_s (float f, float g, float h)
17 return (f * g) - h;
19 // MADD4: msub.s
20 // NOMADD4: mul.s
21 // NOMADD4: sub.s
23 double madd_d (double f, double g, double h)
25 return (f * g) + h;
27 // MADD4: madd.d
28 // NOMADD4: mul.d
29 // NOMADD4: add.d
31 double msub_d (double f, double g, double h)
33 return (f * g) - h;
35 // MADD4: msub.d
36 // NOMADD4: mul.d
37 // NOMADD4: sub.d
40 float nmadd_s (float f, float g, float h)
42 // FIXME: Zero has been explicitly placed to force generation of a positive
43 // zero in IR until pattern used to match this instruction is changed to
44 // comply with negative zero as well.
45 return 0-((f * g) + h);
47 // MADD4-NONAN: nmadd.s
48 // NOMADD4-NONAN: mul.s
49 // NOMADD4-NONAN: add.s
50 // NOMADD4-NONAN: sub.s
52 float nmsub_s (float f, float g, float h)
54 // FIXME: Zero has been explicitly placed to force generation of a positive
55 // zero in IR until pattern used to match this instruction is changed to
56 // comply with negative zero as well.
57 return 0-((f * g) - h);
59 // MADD4-NONAN: nmsub.s
60 // NOMADD4-NONAN: mul.s
61 // NOMADD4-NONAN: sub.s
62 // NOMADD4-NONAN: sub.s
64 double nmadd_d (double f, double g, double h)
66 // FIXME: Zero has been explicitly placed to force generation of a positive
67 // zero in IR until pattern used to match this instruction is changed to
68 // comply with negative zero as well.
69 return 0-((f * g) + h);
71 // MADD4-NONAN: nmadd.d
72 // NOMADD4-NONAN: mul.d
73 // NOMADD4-NONAN: add.d
74 // NOMADD4-NONAN: sub.d
76 double nmsub_d (double f, double g, double h)
78 // FIXME: Zero has been explicitly placed to force generation of a positive
79 // zero in IR until pattern used to match this instruction is changed to
80 // comply with negative zero as well.
81 return 0-((f * g) - h);
83 // MADD4-NONAN: nmsub.d
84 // NOMADD4-NONAN: mul.d
85 // NOMADD4-NONAN: sub.d
86 // NOMADD4-NONAN: sub.d