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
55 lines
2.7 KiB
C
55 lines
2.7 KiB
C
// RUN: %clang_cc1 -ffixed-point -triple x86_64-unknown-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,SIGNED
|
|
// RUN: %clang_cc1 -ffixed-point -triple x86_64-unknown-linux-gnu -fpadding-on-unsigned-fixed-point -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,UNSIGNED
|
|
|
|
// Multiplication between different fixed point types
|
|
short _Accum sa_const = 2.0hk * 2.0hk;
|
|
// CHECK-DAG: @sa_const = {{.*}}global i16 512, align 2
|
|
_Accum a_const = 3.0hk * 2.0k;
|
|
// CHECK-DAG: @a_const = {{.*}}global i32 196608, align 4
|
|
long _Accum la_const = 4.0hk * 2.0lk;
|
|
// CHECK-DAG: @la_const = {{.*}}global i64 17179869184, align 8
|
|
short _Accum sa_const2 = 0.5hr * 2.0hk;
|
|
// CHECK-DAG: @sa_const2 = {{.*}}global i16 128, align 2
|
|
short _Accum sa_const3 = 0.5r * 3.0hk;
|
|
// CHECK-DAG: @sa_const3 = {{.*}}global i16 192, align 2
|
|
short _Accum sa_const4 = 0.5lr * 4.0hk;
|
|
// CHECK-DAG: @sa_const4 = {{.*}}global i16 256, align 2
|
|
|
|
// Unsigned multiplication
|
|
unsigned short _Accum usa_const = 1.0uhk * 2.0uhk;
|
|
// SIGNED-DAG: @usa_const = {{.*}}global i16 512, align 2
|
|
// UNSIGNED-DAG: @usa_const = {{.*}}global i16 256, align 2
|
|
|
|
// Unsigned * signed
|
|
short _Accum sa_const5 = 20.0uhk * 3.0hk;
|
|
// CHECK-DAG: @sa_const5 = {{.*}}global i16 7680, align 2
|
|
|
|
// Multiplication with negative number
|
|
short _Accum sa_const6 = 0.5hr * (-2.0hk);
|
|
// CHECK-DAG: @sa_const6 = {{.*}}global i16 -128, align 2
|
|
|
|
// Int multiplication
|
|
unsigned short _Accum usa_const2 = 5 * 10.5uhk;
|
|
// SIGNED-DAG: @usa_const2 = {{.*}}global i16 13440, align 2
|
|
// UNSIGNED-DAG: @usa_const2 = {{.*}}global i16 6720, align 2
|
|
short _Accum sa_const7 = 3 * (-0.5hk);
|
|
// CHECK-DAG: @sa_const7 = {{.*}}global i16 -192, align 2
|
|
short _Accum sa_const8 = 100 * (-2.0hk);
|
|
// CHECK-DAG: @sa_const8 = {{.*}}global i16 -25600, align 2
|
|
long _Fract lf_const = -0.25lr * 3;
|
|
// CHECK-DAG: @lf_const = {{.*}}global i32 -1610612736, align 4
|
|
|
|
// Saturated multiplication
|
|
_Sat short _Accum sat_sa_const = (_Sat short _Accum)128.0hk * 3.0hk;
|
|
// CHECK-DAG: @sat_sa_const = {{.*}}global i16 32767, align 2
|
|
_Sat unsigned short _Accum sat_usa_const = (_Sat unsigned short _Accum)128.0uhk * 128.0uhk;
|
|
// SIGNED-DAG: @sat_usa_const = {{.*}}global i16 -1, align 2
|
|
// UNSIGNED-DAG: @sat_usa_const = {{.*}}global i16 32767, align 2
|
|
_Sat short _Accum sat_sa_const2 = (_Sat short _Accum)128.0hk * -128;
|
|
// CHECK-DAG: @sat_sa_const2 = {{.*}}global i16 -32768, align 2
|
|
_Sat unsigned short _Accum sat_usa_const2 = (_Sat unsigned short _Accum)128.0uhk * 30;
|
|
// SIGNED-DAG: @sat_usa_const2 = {{.*}}global i16 -1, align 2
|
|
// UNSIGNED-DAG: @sat_usa_const2 = {{.*}}global i16 32767, align 2
|
|
_Sat unsigned short _Accum sat_usa_const3 = (_Sat unsigned short _Accum)0.5uhk * (-2);
|
|
// CHECK-DAG: @sat_usa_const3 = {{.*}}global i16 0, align 2
|