brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.6 KiB · 836b41b Raw
62 lines · c
1// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a57 \2// RUN:     -ffreestanding -disable-O0-optnone -emit-llvm %s -o - | \3// RUN:     opt -S -passes=mem2reg,sroa | FileCheck -check-prefixes=COMMON,COMMONIR,UNCONSTRAINED %s4// RUN: %clang_cc1 -triple arm64-linux-gnueabihf -target-feature +neon \5// RUN:     -ffreestanding -disable-O0-optnone -emit-llvm %s -o - | \6// RUN:     opt -S -passes=mem2reg,sroa | FileCheck -check-prefixes=COMMON,COMMONIR,UNCONSTRAINED %s7 8// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a57 \9// RUN:     -ffp-exception-behavior=strict \10// RUN:     -fexperimental-strict-floating-point \11// RUN:     -ffreestanding -disable-O0-optnone -emit-llvm %s -o - | \12// RUN:     opt -S -passes=mem2reg,sroa | FileCheck -check-prefixes=COMMON,COMMONIR,CONSTRAINED %s13// RUN: %clang_cc1 -triple arm64-linux-gnueabihf -target-feature +neon \14// RUN:     -ffp-exception-behavior=strict \15// RUN:     -ffreestanding -disable-O0-optnone -emit-llvm %s -o - | \16// RUN:     opt -S -passes=mem2reg,sroa | FileCheck -check-prefixes=COMMON,COMMONIR,CONSTRAINED %s17 18// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a57 \19// RUN:     -ffreestanding -disable-O0-optnone -emit-llvm %s -o - | \20// RUN:     opt -S -passes=mem2reg,sroa | llc -o=- - | FileCheck -check-prefixes=COMMON,CHECK-ASM32 %s21// RUN: %clang_cc1 -triple arm64-linux-gnueabihf -target-feature +neon \22// RUN:     -ffreestanding -disable-O0-optnone -emit-llvm %s -o - | \23// RUN:     opt -S -passes=mem2reg,sroa | llc -o=- - | FileCheck -check-prefixes=COMMON,CHECK-ASM64 %s24 25// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a57 \26// RUN:     -ffp-exception-behavior=strict \27// RUN:     -fexperimental-strict-floating-point \28// RUN:     -ffreestanding -disable-O0-optnone -emit-llvm %s -o - | \29// RUN:     opt -S -passes=mem2reg,sroa | llc -o=- - | FileCheck -check-prefixes=COMMON,CHECK-ASM32 %s30// RUN: %clang_cc1 -triple arm64-linux-gnueabihf -target-feature +neon \31// RUN:     -ffp-exception-behavior=strict \32// RUN:     -ffreestanding -disable-O0-optnone -emit-llvm %s -o - | \33// RUN:     opt -S -passes=mem2reg,sroa | llc -o=- - | FileCheck -check-prefixes=COMMON,CHECK-ASM64 %s34 35// REQUIRES: arm-registered-target,aarch64-registered-target36 37#include <arm_neon.h>38 39// COMMON-LABEL: test_vrndi_f3240// UNCONSTRAINED: [[VRNDI1_I:%.*]] = call <2 x float> @llvm.nearbyint.v2f32(<2 x float> [[VRNDI_I:%.*]])41// CONSTRAINED:   [[VRNDI1_I:%.*]] = call <2 x float> @llvm.experimental.constrained.nearbyint.v2f32(<2 x float> [[VRNDI_I:%.*]], metadata !"round.tonearest", metadata !"fpexcept.strict")42// CHECK-ASM32:   vrintr.f32 s{{[0-9]+}}, s{{[0-9]+}}43// CHECK-ASM32:   vrintr.f32 s{{[0-9]+}}, s{{[0-9]+}}44// CHECK-ASM64:   frinti v{{[0-9]+}}.2s, v{{[0-9]+}}.2s45// COMMONIR:      ret <2 x float> [[VRNDI1_I]]46float32x2_t test_vrndi_f32(float32x2_t a) {47  return vrndi_f32(a);48}49 50// COMMON-LABEL: test_vrndiq_f3251// UNCONSTRAINED: [[VRNDI1_I:%.*]] = call <4 x float> @llvm.nearbyint.v4f32(<4 x float> [[VRNDI_I:%.*]])52// CONSTRAINED:   [[VRNDI1_I:%.*]] = call <4 x float> @llvm.experimental.constrained.nearbyint.v4f32(<4 x float> [[VRNDI_I:%.*]], metadata !"round.tonearest", metadata !"fpexcept.strict")53// CHECK-ASM32:   vrintr.f32 s{{[0-9]+}}, s{{[0-9]+}}54// CHECK-ASM32:   vrintr.f32 s{{[0-9]+}}, s{{[0-9]+}}55// CHECK-ASM32:   vrintr.f32 s{{[0-9]+}}, s{{[0-9]+}}56// CHECK-ASM32:   vrintr.f32 s{{[0-9]+}}, s{{[0-9]+}}57// CHECK-ASM64:   frinti v{{[0-9]+}}.4s, v{{[0-9]+}}.4s58// COMMONIR:      ret <4 x float> [[VRNDI1_I]]59float32x4_t test_vrndiq_f32(float32x4_t a) {60  return vrndiq_f32(a);61}62