1 // RUN: %clang_cc1 %s -emit-llvm -o - -triple -amdgcn-amd-amdhsa \ 2 // RUN: -target-cpu gfx906 -fcuda-is-device -x hip \ 3 // RUN: | FileCheck --check-prefixes=COMMON,CRDIV %s 4 // RUN: %clang_cc1 %s -emit-llvm -o - -triple -amdgcn-amd-amdhsa \ 5 // RUN: -target-cpu gfx906 -fcuda-is-device -x hip \ 6 // RUN: -fno-hip-fp32-correctly-rounded-divide-sqrt \ 7 // RUN: | FileCheck --check-prefixes=COMMON,NCRDIV %s 8 9 #include "Inputs/cuda.h" 10 11 typedef __attribute__(( ext_vector_type(4) )) float float4; 12 13 // COMMON-LABEL: @_Z11spscalardiv 14 // COMMON: fdiv{{.*}}, 15 // NCRDIV: !fpmath ![[MD:[0-9]+]] 16 // CRDIV-NOT: !fpmath 17 __device__ float spscalardiv(float a, float b) { 18 return a / b; 19 } 20 21 // COMMON-LABEL: @_Z11spvectordiv 22 // COMMON: fdiv{{.*}}, 23 // NCRDIV: !fpmath ![[MD]] 24 // CRDIV-NOT: !fpmath 25 __device__ float4 spvectordiv(float4 a, float4 b) { 26 return a / b; 27 } 28 29 // COMMON-LABEL: @_Z11dpscalardiv 30 // COMMON-NOT: !fpmath 31 __device__ double dpscalardiv(double a, double b) { 32 return a / b; 33 } 34 35 // NCRDIV: ![[MD]] = !{float 2.500000e+00} 36