102 lines · plain
1; Check that abs.[ds] is only selected for mips32r6 or mips64r6 when no2; additional options are passed. For revisions prior mips32r6 and mips64r6,3; abs.[ds] does not generate the correct result when working with NaNs, and4; should be explicitly enabled with -enable-no-nans-fp-math or +abs2008 options.5 6; In 1985 mode, abs.[ds] are arithmetic (i.e. they raise invalid operation7; exceptions when given NaN's). In 2008 mode, they are non-arithmetic (i.e.8; they are copies and don't raise any exceptions).9 10; Testing default values11; RUN: llc < %s -mtriple=mipsel-linux-gnu -mcpu=mips32 | FileCheck %s \12; RUN: -check-prefix=CHECK-ABSLEGACY13; RUN: llc < %s -mtriple=mips64el-linux-gnu -mcpu=mips64 | FileCheck %s \14; RUN: -check-prefix=CHECK-ABSLEGACY15; RUN: llc < %s -mtriple=mipsel-linux-gnu -mcpu=mips32r2 | FileCheck %s \16; RUN: -check-prefix=CHECK-ABSLEGACY17; RUN: llc < %s -mtriple=mips64el-linux-gnu -mcpu=mips64r2 | FileCheck %s \18; RUN: -check-prefix=CHECK-ABSLEGACY19; RUN: llc < %s -mtriple=mipsel-linux-gnu -mcpu=mips32r6 | FileCheck %s \20; RUN: -check-prefix=CHECK-ABS200821; RUN: llc < %s -mtriple=mips64el-linux-gnu -mcpu=mips64r6 | FileCheck %s \22; RUN: -check-prefix=CHECK-ABS200823; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32 | FileCheck %s \24; RUN: -check-prefix=CHECK-ABSLEGACY25; RUN: llc < %s -mtriple=mips64-linux-gnu -mcpu=mips64 | FileCheck %s \26; RUN: -check-prefix=CHECK-ABSLEGACY27; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32r2 | FileCheck %s \28; RUN: -check-prefix=CHECK-ABSLEGACY29; RUN: llc < %s -mtriple=mips64-linux-gnu -mcpu=mips64r2 | FileCheck %s \30; RUN: -check-prefix=CHECK-ABSLEGACY31; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32r6 | FileCheck %s \32; RUN: -check-prefix=CHECK-ABS200833; RUN: llc < %s -mtriple=mips64-linux-gnu -mcpu=mips64r6 | FileCheck %s \34; RUN: -check-prefix=CHECK-ABS200835; Testing non-default values36; RUN: llc < %s -mtriple=mipsel-linux-gnu -mcpu=mips32r2 -mattr=+abs2008 \37; RUN: | FileCheck %s -check-prefix=CHECK-ABS200838; RUN: llc < %s -mtriple=mips64el-linux-gnu -mcpu=mips64r2 -mattr=+abs2008 \39; RUN: | FileCheck %s -check-prefix=CHECK-ABS200840; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32r2 -mattr=+abs2008 \41; RUN: | FileCheck %s -check-prefix=CHECK-ABS200842; RUN: llc < %s -mtriple=mips64-linux-gnu -mcpu=mips64r2 -mattr=+abs2008 \43; RUN: | FileCheck %s -check-prefix=CHECK-ABS200844; Testing -enable-no-nans-fp-math45; RUN: llc < %s -mtriple=mipsel-linux-gnu -mcpu=mips32 \46; RUN: -enable-no-nans-fp-math | FileCheck %s -check-prefix=CHECK-ABS200847; RUN: llc < %s -mtriple=mips64el-linux-gnu -mcpu=mips64 \48; RUN: -enable-no-nans-fp-math | FileCheck %s -check-prefix=CHECK-ABS200849; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32 \50; RUN: -enable-no-nans-fp-math | FileCheck %s -check-prefix=CHECK-ABS200851; RUN: llc < %s -mtriple=mips64-linux-gnu -mcpu=mips64 \52; RUN: -enable-no-nans-fp-math | FileCheck %s -check-prefix=CHECK-ABS200853 54; microMIPS55; Testing default values56; RUN: llc < %s -mtriple=mipsel-linux-gnu -mcpu=mips32 -mattr=+micromips \57; RUN: | FileCheck %s -check-prefix=CHECK-ABSLEGACY58; RUN: llc < %s -mtriple=mipsel-linux-gnu -mcpu=mips32r2 -mattr=+micromips \59; RUN: | FileCheck %s -check-prefix=CHECK-ABSLEGACY60; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32 -mattr=+micromips \61; RUN: | FileCheck %s -check-prefix=CHECK-ABSLEGACY62; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32r2 -mattr=+micromips \63; RUN: | FileCheck %s -check-prefix=CHECK-ABSLEGACY64; Testing non-default values65; RUN: llc < %s -mtriple=mipsel-linux-gnu -mcpu=mips32r2 \66; RUN: -mattr=+abs2008,+micromips | FileCheck %s -check-prefix=CHECK-ABS200867; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32r2 \68; RUN: -mattr=+abs2008,+micromips | FileCheck %s -check-prefix=CHECK-ABS200869; Testing -enable-no-nans-fp-math70; RUN: llc < %s -mtriple=mipsel-linux-gnu -mcpu=mips32 -mattr=+micromips \71; RUN: -enable-no-nans-fp-math | FileCheck %s -check-prefix=CHECK-ABS200872; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32 -mattr=+micromips \73; RUN: -enable-no-nans-fp-math | FileCheck %s -check-prefix=CHECK-ABS200874 75define float @foo0(float %a) nounwind readnone {76entry:77 78; CHECK-LABEL: foo079; CHECK-ABS2008: abs.s80; CHECK-ABSLEGACY: {{(ori|ins)}}81; CHECK-ABSLEGACY-NOT: abs.s82 83 %call = tail call float @fabsf(float %a) nounwind readnone84 ret float %call85}86 87declare float @fabsf(float) nounwind readnone88 89define double @foo1(double %a) nounwind readnone {90entry:91 92; CHECK-LABEL: foo1:93; CHECK-ABS2008: abs.d94; CHECK-ABSLEGACY: {{(ori|ins|dsll)}}95; CHECK-ABSLEGACY-NOT: abs.d96 97 %call = tail call double @fabs(double %a) nounwind readnone98 ret double %call99}100 101declare double @fabs(double) nounwind readnone102