brintos

brintos / llvm-project-archived public Read only

0
0
Text · 11.2 KiB · 5946265 Raw
217 lines · c
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py2// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2 -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s3// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2 -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK4// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s5// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK6 7// REQUIRES: aarch64-registered-target8 9#include <arm_sve.h>10 11#ifdef SVE_OVERLOADED_FORMS12// A simple used,unused... macro, long enough to represent any SVE builtin.13#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A314#else15#define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A416#endif17 18// CHECK-LABEL: @test_svwhilerw_s8(19// CHECK-NEXT:  entry:20// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilerw.b.nxv16i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])21// CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]22//23// CPP-CHECK-LABEL: @_Z17test_svwhilerw_s8PKaS0_(24// CPP-CHECK-NEXT:  entry:25// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilerw.b.nxv16i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])26// CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]27//28svbool_t test_svwhilerw_s8(const int8_t *op1, const int8_t *op2)29{30  return SVE_ACLE_FUNC(svwhilerw,_s8,,)(op1, op2);31}32 33// CHECK-LABEL: @test_svwhilerw_s16(34// CHECK-NEXT:  entry:35// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])36// CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])37// CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]38//39// CPP-CHECK-LABEL: @_Z18test_svwhilerw_s16PKsS0_(40// CPP-CHECK-NEXT:  entry:41// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])42// CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])43// CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]44//45svbool_t test_svwhilerw_s16(const int16_t *op1, const int16_t *op2)46{47  return SVE_ACLE_FUNC(svwhilerw,_s16,,)(op1, op2);48}49 50// CHECK-LABEL: @test_svwhilerw_s32(51// CHECK-NEXT:  entry:52// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilerw.s.nxv4i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])53// CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])54// CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]55//56// CPP-CHECK-LABEL: @_Z18test_svwhilerw_s32PKiS0_(57// CPP-CHECK-NEXT:  entry:58// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilerw.s.nxv4i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])59// CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])60// CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]61//62svbool_t test_svwhilerw_s32(const int32_t *op1, const int32_t *op2)63{64  return SVE_ACLE_FUNC(svwhilerw,_s32,,)(op1, op2);65}66 67// CHECK-LABEL: @test_svwhilerw_s64(68// CHECK-NEXT:  entry:69// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilerw.d.nxv2i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])70// CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])71// CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]72//73// CPP-CHECK-LABEL: @_Z18test_svwhilerw_s64PKlS0_(74// CPP-CHECK-NEXT:  entry:75// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilerw.d.nxv2i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])76// CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])77// CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]78//79svbool_t test_svwhilerw_s64(const int64_t *op1, const int64_t *op2)80{81  return SVE_ACLE_FUNC(svwhilerw,_s64,,)(op1, op2);82}83 84// CHECK-LABEL: @test_svwhilerw_u8(85// CHECK-NEXT:  entry:86// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilerw.b.nxv16i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])87// CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]88//89// CPP-CHECK-LABEL: @_Z17test_svwhilerw_u8PKhS0_(90// CPP-CHECK-NEXT:  entry:91// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilerw.b.nxv16i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])92// CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]93//94svbool_t test_svwhilerw_u8(const uint8_t *op1, const uint8_t *op2)95{96  return SVE_ACLE_FUNC(svwhilerw,_u8,,)(op1, op2);97}98 99// CHECK-LABEL: @test_svwhilerw_u16(100// CHECK-NEXT:  entry:101// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])102// CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])103// CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]104//105// CPP-CHECK-LABEL: @_Z18test_svwhilerw_u16PKtS0_(106// CPP-CHECK-NEXT:  entry:107// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])108// CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])109// CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]110//111svbool_t test_svwhilerw_u16(const uint16_t *op1, const uint16_t *op2)112{113  return SVE_ACLE_FUNC(svwhilerw,_u16,,)(op1, op2);114}115 116// CHECK-LABEL: @test_svwhilerw_u32(117// CHECK-NEXT:  entry:118// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilerw.s.nxv4i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])119// CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])120// CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]121//122// CPP-CHECK-LABEL: @_Z18test_svwhilerw_u32PKjS0_(123// CPP-CHECK-NEXT:  entry:124// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilerw.s.nxv4i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])125// CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])126// CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]127//128svbool_t test_svwhilerw_u32(const uint32_t *op1, const uint32_t *op2)129{130  return SVE_ACLE_FUNC(svwhilerw,_u32,,)(op1, op2);131}132 133// CHECK-LABEL: @test_svwhilerw_u64(134// CHECK-NEXT:  entry:135// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilerw.d.nxv2i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])136// CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])137// CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]138//139// CPP-CHECK-LABEL: @_Z18test_svwhilerw_u64PKmS0_(140// CPP-CHECK-NEXT:  entry:141// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilerw.d.nxv2i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])142// CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])143// CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]144//145svbool_t test_svwhilerw_u64(const uint64_t *op1, const uint64_t *op2)146{147  return SVE_ACLE_FUNC(svwhilerw,_u64,,)(op1, op2);148}149 150// CHECK-LABEL: @test_svwhilerw_f16(151// CHECK-NEXT:  entry:152// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])153// CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])154// CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]155//156// CPP-CHECK-LABEL: @_Z18test_svwhilerw_f16PKDhS0_(157// CPP-CHECK-NEXT:  entry:158// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])159// CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])160// CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]161//162svbool_t test_svwhilerw_f16(const float16_t *op1, const float16_t *op2)163{164  return SVE_ACLE_FUNC(svwhilerw,_f16,,)(op1, op2);165}166 167// CHECK-LABEL: @test_svwhilerw_f32(168// CHECK-NEXT:  entry:169// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilerw.s.nxv4i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])170// CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])171// CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]172//173// CPP-CHECK-LABEL: @_Z18test_svwhilerw_f32PKfS0_(174// CPP-CHECK-NEXT:  entry:175// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilerw.s.nxv4i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])176// CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])177// CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]178//179svbool_t test_svwhilerw_f32(const float32_t *op1, const float32_t *op2)180{181  return SVE_ACLE_FUNC(svwhilerw,_f32,,)(op1, op2);182}183 184// CHECK-LABEL: @test_svwhilerw_f64(185// CHECK-NEXT:  entry:186// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilerw.d.nxv2i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])187// CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])188// CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]189//190// CPP-CHECK-LABEL: @_Z18test_svwhilerw_f64PKdS0_(191// CPP-CHECK-NEXT:  entry:192// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilerw.d.nxv2i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])193// CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])194// CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]195//196svbool_t test_svwhilerw_f64(const float64_t *op1, const float64_t *op2)197{198  return SVE_ACLE_FUNC(svwhilerw,_f64,,)(op1, op2);199}200 201// CHECK-LABEL: @test_svwhilerw_bf16(202// CHECK-NEXT:  entry:203// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])204// CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])205// CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]206//207// CPP-CHECK-LABEL: @_Z19test_svwhilerw_bf16PKu6__bf16S0_(208// CPP-CHECK-NEXT:  entry:209// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])210// CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])211// CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]212//213svbool_t test_svwhilerw_bf16(const bfloat16_t *op1, const bfloat16_t *op2)214{215  return SVE_ACLE_FUNC(svwhilerw,_bf16,,)(op1, op2);216}217