brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · ea85d6f Raw
53 lines · c
1// RUN: %clang_cc1 -ffixed-point -triple x86_64-unknown-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,SIGNED2// 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,UNSIGNED3 4short _Accum sa_const1 = 1.0hk << 2;5// CHECK-DAG: @sa_const1 = {{.*}}global i16 5126short _Accum sa_const2 = 0.5hk << 2;7// CHECK-DAG: @sa_const2 = {{.*}}global i16 2568short _Accum sa_const3 = 10.0hk >> 3;9// CHECK-DAG: @sa_const3 = {{.*}}global i16 16010short _Accum sa_const4 = 0.0546875hk << 8;11// CHECK-DAG: @sa_const4 = {{.*}}global i16 179212short _Accum sa_const5 = -1.0hk << 2;13// CHECK-DAG: @sa_const5 = {{.*}}global i16 -51214short _Accum sa_const6 = -255.0hk >> 8;15// CHECK-DAG: @sa_const6 = {{.*}}global i16 -12816 17_Fract f_const1 = -1.0r >> 5;18// CHECK-DAG: @f_const1 = {{.*}}global i16 -102419_Fract f_const2 = 0.0052490234375r >> 3;20// CHECK-DAG: @f_const2 = {{.*}}global i16 2121_Fract f_const3 = -0.0001r << 5;22// CHECK-DAG: @f_const3 = {{.*}}global i16 -9623_Fract f_const4 = -0.75r >> 15;24// CHECK-DAG: @f_const4 = {{.*}}global i16 -125_Fract f_const5 = 0.078216552734375r << 3;26// CHECK-DAG: @f_const5 = {{.*}}global i16 2050427 28unsigned _Fract uf_const1 = 0.375ur >> 13;29// SIGNED-DAG:   @uf_const1 = {{.*}}global i16 330// UNSIGNED-DAG: @uf_const1 = {{.*}}global i16 131unsigned _Fract uf_const2 = 0.0546875ur << 3;32// SIGNED-DAG:   @uf_const2 = {{.*}}global i16 2867233// UNSIGNED-DAG: @uf_const2 = {{.*}}global i16 1433634 35_Sat short _Accum ssa_const1 = (_Sat short _Accum)31.875hk << 4;36// CHECK-DAG: @ssa_const1 = {{.*}}global i16 3276737_Sat short _Accum ssa_const2 = (_Sat short _Accum) - 1.0hk << 8;38// CHECK-DAG: @ssa_const2 = {{.*}}global i16 -3276839_Sat short _Accum ssa_const3 = (_Sat short _Accum)128.0hk << 8;40// CHECK-DAG: @ssa_const3 = {{.*}}global i16 3276741_Sat short _Fract ssf_const1 = (_Sat short _Fract) - 0.5hr << 3;42// CHECK-DAG: @ssf_const1 = {{.*}}global i8 -12843 44_Sat unsigned _Fract suf_const1 = (_Sat unsigned _Fract)0.5r << 1;45// SIGNED-DAG:   @suf_const1 = {{.*}}global i16 -146// UNSIGNED-DAG: @suf_const1 = {{.*}}global i16 3276747_Sat unsigned _Fract suf_const2 = (_Sat unsigned _Fract)0.25r << 1;48// SIGNED-DAG:   @suf_const2 = {{.*}}global i16 -3276849// UNSIGNED-DAG: @suf_const2 = {{.*}}global i16 1638450_Sat unsigned _Accum sua_const2 = (_Sat unsigned _Accum)128.0uk << 10;51// SIGNED-DAG:   @sua_const2 = {{.*}}global i32 -152// UNSIGNED-DAG: @sua_const2 = {{.*}}global i32 214748364753