CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
53 lines
1.6 KiB
Common Lisp
53 lines
1.6 KiB
Common Lisp
/*===--------------------------------------------------------------------------
|
|
* ROCm Device Libraries
|
|
*
|
|
* This file is distributed under the University of Illinois Open Source
|
|
* License. See LICENSE.TXT for details.
|
|
*===------------------------------------------------------------------------*/
|
|
|
|
#include "mathD.h"
|
|
|
|
CONSTATTR double
|
|
MATH_MANGLE(len4)(double x, double y, double z, double w)
|
|
{
|
|
double a = BUILTIN_ABS_F64(x);
|
|
double b = BUILTIN_ABS_F64(y);
|
|
double c = BUILTIN_ABS_F64(z);
|
|
double d = BUILTIN_ABS_F64(w);
|
|
|
|
double a1 = BUILTIN_MAX_F64(a, b);
|
|
double b1 = BUILTIN_MIN_F64(a, b);
|
|
|
|
double c1 = BUILTIN_MAX_F64(c, d);
|
|
double d1 = BUILTIN_MIN_F64(c, d);
|
|
|
|
a = BUILTIN_MAX_F64(a1, c1);
|
|
double c2 = BUILTIN_MIN_F64(a1, c1);
|
|
|
|
double b2 = BUILTIN_MAX_F64(b1, d1);
|
|
d = BUILTIN_MIN_F64(b1, d1);
|
|
|
|
b = BUILTIN_MAX_F64(b2, c2);
|
|
c = BUILTIN_MIN_F64(b2, c2);
|
|
|
|
int e = BUILTIN_FREXP_EXP_F64(a);
|
|
a = BUILTIN_FLDEXP_F64(a, -e);
|
|
b = BUILTIN_FLDEXP_F64(b, -e);
|
|
c = BUILTIN_FLDEXP_F64(c, -e);
|
|
d = BUILTIN_FLDEXP_F64(d, -e);
|
|
|
|
double ret = BUILTIN_FLDEXP_F64(MATH_FAST_SQRT(MATH_MAD(a, a, MATH_MAD(b, b, MATH_MAD(c, c, d*d)))), e);
|
|
|
|
if (!FINITE_ONLY_OPT()) {
|
|
ret = (BUILTIN_ISUNORDERED_F64(x, y) |
|
|
BUILTIN_ISUNORDERED_F64(z, w)) ? QNAN_F64 : ret;
|
|
ret = (BUILTIN_ISINF_F64(x) |
|
|
BUILTIN_ISINF_F64(y) |
|
|
BUILTIN_ISINF_F64(z) |
|
|
BUILTIN_ISINF_F64(w)) ? PINF_F64 : ret;
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|