|
| 1 | +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py |
| 2 | +// REQUIRES: aarch64-registered-target |
| 3 | +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s |
| 4 | +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK |
| 5 | +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s |
| 6 | +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -S -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK |
| 7 | +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -O1 -Werror -Wall -o /dev/null %s |
| 8 | + |
| 9 | +// Note: We need to run this test with '-O1' because oddly enough the svreinterpret is always inlined at -O0. |
| 10 | + |
| 11 | +#include <arm_sve.h> |
| 12 | + |
| 13 | +#ifdef SVE_OVERLOADED_FORMS |
| 14 | +// A simple used,unused... macro, long enough to represent any SVE builtin. |
| 15 | +#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3 |
| 16 | +#else |
| 17 | +#define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4 |
| 18 | +#endif |
| 19 | + |
| 20 | +// Test that svreinterpret is inlined (because it should be streaming-compatible) |
| 21 | +__attribute__((target("sme"))) |
| 22 | +// CHECK-LABEL: @test_svreinterpret_s16_s8_from_streaming_mode( |
| 23 | +// CHECK-NEXT: entry: |
| 24 | +// CHECK-NEXT: [[TMP0:%.*]] = bitcast <vscale x 16 x i8> [[OP:%.*]] to <vscale x 8 x i16> |
| 25 | +// CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 26 | +// |
| 27 | +// CPP-CHECK-LABEL: @_Z45test_svreinterpret_s16_s8_from_streaming_modeu10__SVInt8_t( |
| 28 | +// CPP-CHECK-NEXT: entry: |
| 29 | +// CPP-CHECK-NEXT: [[TMP0:%.*]] = bitcast <vscale x 16 x i8> [[OP:%.*]] to <vscale x 8 x i16> |
| 30 | +// CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 31 | +// |
| 32 | +svint16_t test_svreinterpret_s16_s8_from_streaming_mode(svint8_t op) __arm_streaming { |
| 33 | + return SVE_ACLE_FUNC(svreinterpret_s16,_s8,,)(op); |
| 34 | +} |
| 35 | + |
0 commit comments