xref: /llvm-project/clang/test/CodeGen/AArch64/sve-intrinsics/acle_sve_tsmul.c (revision 207e5ccceec8d3cc3f32723e78f2a142bc61b07d)
1*207e5cccSFangrui Song // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2*207e5cccSFangrui Song // REQUIRES: aarch64-registered-target
3*207e5cccSFangrui Song // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
4*207e5cccSFangrui Song // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
5*207e5cccSFangrui Song // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
6*207e5cccSFangrui Song // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
7*207e5cccSFangrui Song // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
8*207e5cccSFangrui Song #include <arm_sve.h>
9*207e5cccSFangrui Song 
10*207e5cccSFangrui Song #ifdef SVE_OVERLOADED_FORMS
11*207e5cccSFangrui Song // A simple used,unused... macro, long enough to represent any SVE builtin.
12*207e5cccSFangrui Song #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
13*207e5cccSFangrui Song #else
14*207e5cccSFangrui Song #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
15*207e5cccSFangrui Song #endif
16*207e5cccSFangrui Song 
17*207e5cccSFangrui Song // CHECK-LABEL: @test_svtsmul_f16(
18*207e5cccSFangrui Song // CHECK-NEXT:  entry:
19*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.ftsmul.x.nxv8f16(<vscale x 8 x half> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]])
20*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 8 x half> [[TMP0]]
21*207e5cccSFangrui Song //
22*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z16test_svtsmul_f16u13__SVFloat16_tu12__SVUint16_t(
23*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
24*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.ftsmul.x.nxv8f16(<vscale x 8 x half> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]])
25*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 8 x half> [[TMP0]]
26*207e5cccSFangrui Song //
27*207e5cccSFangrui Song svfloat16_t test_svtsmul_f16(svfloat16_t op1, svuint16_t op2)
28*207e5cccSFangrui Song {
29*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svtsmul,_f16,,)(op1, op2);
30*207e5cccSFangrui Song }
31*207e5cccSFangrui Song 
32*207e5cccSFangrui Song // CHECK-LABEL: @test_svtsmul_f32(
33*207e5cccSFangrui Song // CHECK-NEXT:  entry:
34*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.ftsmul.x.nxv4f32(<vscale x 4 x float> [[OP1:%.*]], <vscale x 4 x i32> [[OP2:%.*]])
35*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 4 x float> [[TMP0]]
36*207e5cccSFangrui Song //
37*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z16test_svtsmul_f32u13__SVFloat32_tu12__SVUint32_t(
38*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
39*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.ftsmul.x.nxv4f32(<vscale x 4 x float> [[OP1:%.*]], <vscale x 4 x i32> [[OP2:%.*]])
40*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 4 x float> [[TMP0]]
41*207e5cccSFangrui Song //
42*207e5cccSFangrui Song svfloat32_t test_svtsmul_f32(svfloat32_t op1, svuint32_t op2)
43*207e5cccSFangrui Song {
44*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svtsmul,_f32,,)(op1, op2);
45*207e5cccSFangrui Song }
46*207e5cccSFangrui Song 
47*207e5cccSFangrui Song // CHECK-LABEL: @test_svtsmul_f64(
48*207e5cccSFangrui Song // CHECK-NEXT:  entry:
49*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.ftsmul.x.nxv2f64(<vscale x 2 x double> [[OP1:%.*]], <vscale x 2 x i64> [[OP2:%.*]])
50*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 2 x double> [[TMP0]]
51*207e5cccSFangrui Song //
52*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z16test_svtsmul_f64u13__SVFloat64_tu12__SVUint64_t(
53*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
54*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.ftsmul.x.nxv2f64(<vscale x 2 x double> [[OP1:%.*]], <vscale x 2 x i64> [[OP2:%.*]])
55*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 2 x double> [[TMP0]]
56*207e5cccSFangrui Song //
57*207e5cccSFangrui Song svfloat64_t test_svtsmul_f64(svfloat64_t op1, svuint64_t op2)
58*207e5cccSFangrui Song {
59*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svtsmul,_f64,,)(op1, op2);
60*207e5cccSFangrui Song }
61