Daniel Sanders | 1b33417 | 2015-10-06 15:17:25 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=mipsel -mcpu=mips32r2 -mattr=+micromips | FileCheck %s |
| 2 | ; RUN: llc < %s -march=mips -mcpu=mips32r2 -mattr=+micromips | FileCheck %s |
| 3 | ; RUN: llc < %s -march=mips -mcpu=mips32r6 -mattr=+micromips | FileCheck %s |
Stefan Maksimovic | 98749e0 | 2018-01-23 10:09:39 +0000 | [diff] [blame] | 4 | ; RUN: llc -march=mips -mcpu=mips32 -asm-show-inst < %s | FileCheck %s --check-prefix=MIPS32 |
| 5 | ; RUN: llc -march=mips -mcpu=mips32r2 -mattr=+fp64 -asm-show-inst < %s | FileCheck %s --check-prefix=MIPS32FP64 |
| 6 | ; RUN: llc -march=mips -mcpu=mips32r3 -mattr=+micromips -asm-show-inst < %s | FileCheck %s --check-prefix=MM |
| 7 | ; RUN: llc -march=mips -mcpu=mips32r3 -mattr=+micromips,+fp64 -asm-show-inst < %s | FileCheck %s --check-prefix=MMFP64 |
| 8 | ; RUN: llc -march=mips -mcpu=mips32r6 -mattr=+micromips -asm-show-inst < %s | FileCheck %s --check-prefix=MMR6 |
Daniel Sanders | 1b33417 | 2015-10-06 15:17:25 +0000 | [diff] [blame] | 9 | |
| 10 | define float @sqrt_fn(float %value) #0 { |
| 11 | entry: |
| 12 | %sqrtf = tail call float @sqrtf(float %value) #0 |
| 13 | ret float %sqrtf |
| 14 | } |
| 15 | |
| 16 | declare float @sqrtf(float) |
| 17 | |
| 18 | ; CHECK: sqrt.s $f0, $f12 |
Stefan Maksimovic | 98749e0 | 2018-01-23 10:09:39 +0000 | [diff] [blame] | 19 | |
| 20 | |
| 21 | define float @sqrt_s(float %a) { |
| 22 | ; MIPS32: sqrt.s {{.*}} # <MCInst #{{[0-9]+}} FSQRT_S |
| 23 | ; MIPS32FP64: sqrt.s {{.*}} # <MCInst #{{[0-9]+}} FSQRT_S |
| 24 | ; MM: sqrt.s {{.*}} # <MCInst #{{[0-9]+}} FSQRT_S_MM |
| 25 | ; MMFP64: sqrt.s {{.*}} # <MCInst #{{[0-9]+}} FSQRT_S_MM |
| 26 | ; MMR6: sqrt.s {{.*}} # <MCInst #{{[0-9]+}} FSQRT_S_MM |
| 27 | %ret = call float @llvm.sqrt.f32(float %a) |
| 28 | ret float %ret |
| 29 | } |
| 30 | |
| 31 | define double @sqrt_d(double %a) { |
| 32 | ; MIPS32: sqrt.d {{.*}} # <MCInst #{{[0-9]+}} FSQRT_D32 |
| 33 | ; MIPS32FP64: sqrt.d {{.*}} # <MCInst #{{[0-9]+}} FSQRT_D64 |
| 34 | ; MM: sqrt.d {{.*}} # <MCInst #{{[0-9]+}} FSQRT_D32_MM |
| 35 | ; MMFP64: sqrt.d {{.*}} # <MCInst #{{[0-9]+}} FSQRT_D64_MM |
| 36 | ; MMR6: sqrt.d {{.*}} # <MCInst #{{[0-9]+}} FSQRT_D64_MM |
| 37 | %ret = call double @llvm.sqrt.f64(double %a) |
| 38 | ret double %ret |
| 39 | } |
| 40 | |
| 41 | declare float @llvm.sqrt.f32(float %a) |
| 42 | declare double @llvm.sqrt.f64(double %a) |