brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · bc7bb59 Raw
88 lines · c
1// REQUIRES: mips-registered-target2// RUN: %clang --target=mips64-unknown-linux -S -mmadd4    %s -o -| FileCheck %s -check-prefix=MADD43// RUN: %clang --target=mips64-unknown-linux -S -mno-madd4 %s -o -| FileCheck %s -check-prefix=NOMADD44// RUN: %clang --target=mips64-unknown-linux -S -mmadd4    -fno-honor-nans %s -o -| FileCheck %s -check-prefix=MADD4-NONAN5// RUN: %clang --target=mips64-unknown-linux -S -mno-madd4 -fno-honor-nans %s -o -| FileCheck %s -check-prefix=NOMADD4-NONAN6 7float madd_s (float f, float g, float h)8{9  return (f * g) + h;10}11// MADD4:   madd.s12// NOMADD4: mul.s13// NOMADD4: add.s14 15float msub_s (float f, float g, float h)16{17  return (f * g) - h;18}19// MADD4:   msub.s20// NOMADD4: mul.s21// NOMADD4: sub.s22 23double madd_d (double f, double g, double h)24{25  return (f * g) + h;26}27// MADD4:   madd.d28// NOMADD4: mul.d29// NOMADD4: add.d30 31double msub_d (double f, double g, double h)32{33  return (f * g) - h;34}35// MADD4:   msub.d36// NOMADD4: mul.d37// NOMADD4: sub.d38 39 40float nmadd_s (float f, float g, float h)41{42  // FIXME: Zero has been explicitly placed to force generation of a positive43  // zero in IR until pattern used to match this instruction is changed to44  // comply with negative zero as well.45  return 0-((f * g) + h);46}47// MADD4-NONAN:   nmadd.s48// NOMADD4-NONAN: mul.s49// NOMADD4-NONAN: add.s50// NOMADD4-NONAN: sub.s51 52float nmsub_s (float f, float g, float h)53{54  // FIXME: Zero has been explicitly placed to force generation of a positive55  // zero in IR until pattern used to match this instruction is changed to56  // comply with negative zero as well.57  return 0-((f * g) - h);58}59// MADD4-NONAN:   nmsub.s60// NOMADD4-NONAN: mul.s61// NOMADD4-NONAN: sub.s62// NOMADD4-NONAN: sub.s63 64double nmadd_d (double f, double g, double h)65{66  // FIXME: Zero has been explicitly placed to force generation of a positive67  // zero in IR until pattern used to match this instruction is changed to68  // comply with negative zero as well.69  return 0-((f * g) + h);70}71// MADD4-NONAN:   nmadd.d72// NOMADD4-NONAN: mul.d73// NOMADD4-NONAN: add.d74// NOMADD4-NONAN: sub.d75 76double nmsub_d (double f, double g, double h)77{78  // FIXME: Zero has been explicitly placed to force generation of a positive79  // zero in IR until pattern used to match this instruction is changed to80  // comply with negative zero as well.81  return 0-((f * g) - h);82}83// MADD4-NONAN:   nmsub.d84// NOMADD4-NONAN: mul.d85// NOMADD4-NONAN: sub.d86// NOMADD4-NONAN: sub.d87 88