Index: libcxx/cmake/caches/Armv7M-picolibc.cmake =================================================================== --- /dev/null +++ libcxx/cmake/caches/Armv7M-picolibc.cmake @@ -0,0 +1,38 @@ +set(CMAKE_ASM_COMPILER_TARGET "armv7m-none-eabi" CACHE STRING "") +set(CMAKE_CXX_COMPILER_TARGET "armv7m-none-eabi" CACHE STRING "") +set(CMAKE_CXX_FLAGS "-mfloat-abi=soft" CACHE STRING "") +set(CMAKE_C_COMPILER_TARGET "armv7m-none-eabi" CACHE STRING "") +set(CMAKE_C_FLAGS "-mfloat-abi=soft" CACHE STRING "") +set(CMAKE_SYSTEM_NAME Generic CACHE STRING "") +set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "") +set(COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL "") +set(COMPILER_RT_BUILD_LIBFUZZER OFF CACHE BOOL "") +set(COMPILER_RT_BUILD_PROFILE OFF CACHE BOOL "") +set(COMPILER_RT_BUILD_SANITIZERS OFF CACHE BOOL "") +set(COMPILER_RT_BUILD_XRAY OFF CACHE BOOL "") +set(COMPILER_RT_DEFAULT_TARGET_ONLY ON CACHE BOOL "") +set(LIBCXXABI_BAREMETAL ON CACHE BOOL "") +set(LIBCXXABI_ENABLE_ASSERTIONS OFF CACHE BOOL "") +set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "") +set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "") +set(LIBCXXABI_ENABLE_STATIC ON CACHE BOOL "") +set(LIBCXXABI_ENABLE_THREADS OFF CACHE BOOL "") +set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "") +set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") +set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "") +set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE STRING "") +set(LIBCXX_ENABLE_MONOTONIC_CLOCK OFF CACHE BOOL "") +set(LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "") +set(LIBCXX_ENABLE_RTTI OFF CACHE BOOL "") +set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "") +set(LIBCXX_ENABLE_STATIC ON CACHE BOOL "") +set(LIBCXX_ENABLE_THREADS OFF CACHE BOOL "") +set(LIBCXX_ENABLE_WIDE_CHARACTERS OFF CACHE BOOL "") +set(LIBCXX_INCLUDE_BENCHMARKS OFF CACHE BOOL "") +set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "") +set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "") +set(LIBUNWIND_ENABLE_STATIC ON CACHE BOOL "") +set(LIBUNWIND_ENABLE_THREADS OFF CACHE BOOL "") +set(LIBUNWIND_IS_BAREMETAL ON CACHE BOOL "") +set(LIBUNWIND_REMEMBER_HEAP_ALLOC ON CACHE BOOL "") +set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") Index: libcxx/docs/index.rst =================================================================== --- libcxx/docs/index.rst +++ libcxx/docs/index.rst @@ -124,16 +124,17 @@ Libc++ also supports common platforms and architectures: -=============== ========================= ============================ -Target platform Target architecture Notes -=============== ========================= ============================ -macOS 10.13+ i386, x86_64, arm64 -FreeBSD 12+ i386, x86_64, arm -Linux i386, x86_64, arm, arm64 Only glibc-2.24 and later and no other libc is officially supported -Android 5.0+ i386, x86_64, arm, arm64 -Windows i386, x86_64 Both MSVC and MinGW style environments, ABI in MSVC environments is :doc:`unstable ` -AIX 7.2TL5+ powerpc, powerpc64 -=============== ========================= ============================ +===================== ========================= ============================ +Target platform Target architecture Notes +===================== ========================= ============================ +macOS 10.13+ i386, x86_64, arm64 +FreeBSD 12+ i386, x86_64, arm +Linux i386, x86_64, arm, arm64 Only glibc-2.24 and later and no other libc is officially supported +Android 5.0+ i386, x86_64, arm, arm64 +Windows i386, x86_64 Both MSVC and MinGW style environments, ABI in MSVC environments is :doc:`unstable ` +AIX 7.2TL5+ powerpc, powerpc64 +Embedded (picolibc) arm Support for building with picolibc is currently work-in-progress +===================== ========================= ============================ Generally speaking, libc++ should work on any platform that provides a fairly complete C Standard Library. It is also possible to turn off parts of the library for use on Index: libcxx/test/configs/armv7m-libc++.cfg.in =================================================================== --- /dev/null +++ libcxx/test/configs/armv7m-libc++.cfg.in @@ -0,0 +1,41 @@ +lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') + +config.substitutions.append(('%{libc-linker-script}', '@CMAKE_INSTALL_PREFIX@/lib/picolibcpp.ld')) + +config.substitutions.append(('%{flags}', '--sysroot=@CMAKE_INSTALL_PREFIX@')) + +config.substitutions.append(('%{compile_flags}', + '-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support' + + # Disable warnings in cxx_atomic_impl.h: + # "large atomic operation may incur significant performance penalty; the + # access size (4 bytes) exceeds the max lock-free size (0 bytes)" + ' -Wno-atomic-alignment' + + # Various libc++ headers check for the definition of _NEWLIB_VERSION + # which for picolibc is defined in picolibc.h. + ' -include picolibc.h' +)) +config.substitutions.append(('%{link_flags}', + '-nostdlib -nostdlib++ -L %{lib} -lc++ -lc++abi' + ' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' + ' -T %{libc-linker-script}' + ' -Wl,--defsym=__flash=0x0' + ' -Wl,--defsym=__flash_size=0x400000' + ' -Wl,--defsym=__ram=0x21000000' + ' -Wl,--defsym=__ram_size=0x1000000' + ' -Wl,--defsym=__stack_size=0x1000' +)) +config.substitutions.append(('%{exec}', + 'true' # TODO use qemu-system-arm +)) + +import os, site +site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils')) +import libcxx.test.params, libcxx.test.config +libcxx.test.config.configure( + libcxx.test.params.DEFAULT_PARAMETERS, + libcxx.test.features.DEFAULT_FEATURES, + config, + lit_config +) Index: libcxx/test/libcxx/clang_modules_include.gen.py =================================================================== --- libcxx/test/libcxx/clang_modules_include.gen.py +++ libcxx/test/libcxx/clang_modules_include.gen.py @@ -39,6 +39,9 @@ // TODO: Investigate this failure // UNSUPPORTED{BLOCKLIT}: LIBCXX-FREEBSD-FIXME +// TODO: Investigate this failure +// UNSUPPORTED{BLOCKLIT}: LIBCXX-PICOLIBC-FIXME + {lit_header_restrictions.get(header, '')} #include <{header}> Index: libcxx/test/libcxx/selftest/dsl/dsl.sh.py =================================================================== --- libcxx/test/libcxx/selftest/dsl/dsl.sh.py +++ libcxx/test/libcxx/selftest/dsl/dsl.sh.py @@ -6,6 +6,9 @@ # # ===----------------------------------------------------------------------===## +# Picolibc test executor is `true` at present. +# XFAIL: LIBCXX-PICOLIBC-FIXME + # Note: We prepend arguments with 'x' to avoid thinking there are too few # arguments in case an argument is an empty string. # RUN: %{python} %s x%S x%T x%{substitutions} Index: libcxx/test/libcxx/selftest/pass.cpp/run-error.pass.cpp =================================================================== --- libcxx/test/libcxx/selftest/pass.cpp/run-error.pass.cpp +++ libcxx/test/libcxx/selftest/pass.cpp/run-error.pass.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME // XFAIL: * // Make sure the test DOES NOT pass if it fails at runtime. Index: libcxx/test/libcxx/selftest/pass.mm/run-error.pass.mm =================================================================== --- libcxx/test/libcxx/selftest/pass.mm/run-error.pass.mm +++ libcxx/test/libcxx/selftest/pass.mm/run-error.pass.mm @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: objective-c++ +// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME // XFAIL: * Index: libcxx/test/libcxx/system_reserved_names.gen.py =================================================================== --- libcxx/test/libcxx/system_reserved_names.gen.py +++ libcxx/test/libcxx/system_reserved_names.gen.py @@ -101,7 +101,10 @@ # define __pre SYSTEM_RESERVED_NAME #endif -#define __input SYSTEM_RESERVED_NAME +// Newlib & picolibc use __input as a parameter name of a64l & l64a +#ifndef _NEWLIB_VERSION +# define __input SYSTEM_RESERVED_NAME +#endif #define __output SYSTEM_RESERVED_NAME #define __acquire SYSTEM_RESERVED_NAME Index: libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp =================================================================== --- libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp +++ libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: !has-64-bit-atomics + // // template <> Index: libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.pass.cpp =================================================================== --- libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.pass.cpp +++ libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: !has-64-bit-atomics + // // template Index: libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp =================================================================== --- libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp +++ libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: !has-64-bit-atomics + // // template Index: libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and.pass.cpp =================================================================== --- libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and.pass.cpp +++ libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: !has-64-bit-atomics + // // template Index: libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp =================================================================== --- libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp +++ libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: !has-64-bit-atomics + // // template Index: libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or.pass.cpp =================================================================== --- libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or.pass.cpp +++ libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: !has-64-bit-atomics + // // template Index: libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or_explicit.pass.cpp =================================================================== --- libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or_explicit.pass.cpp +++ libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or_explicit.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: !has-64-bit-atomics + // // template Index: libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.pass.cpp =================================================================== --- libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.pass.cpp +++ libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: !has-64-bit-atomics + // // template Index: libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.pass.cpp =================================================================== --- libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.pass.cpp +++ libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: !has-64-bit-atomics + // // template Index: libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor.pass.cpp =================================================================== --- libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor.pass.cpp +++ libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: !has-64-bit-atomics + // // template Index: libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor_explicit.pass.cpp =================================================================== --- libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor_explicit.pass.cpp +++ libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor_explicit.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: !has-64-bit-atomics + // // template Index: libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp =================================================================== --- libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp +++ libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp @@ -8,6 +8,8 @@ // UNSUPPORTED: c++03 +// XFAIL: !has-64-bit-atomics + // // constexpr atomic::atomic(T value) Index: libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp =================================================================== --- libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp +++ libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp @@ -6,6 +6,9 @@ // //===----------------------------------------------------------------------===// +// Floating point exceptions are required for the FE_... macros to be defined. +// XFAIL: LIBCXX-PICOLIBC-FIXME + // #include Index: libcxx/test/std/depr/depr.c.headers/stdio_h.compile.pass.cpp =================================================================== --- libcxx/test/std/depr/depr.c.headers/stdio_h.compile.pass.cpp +++ libcxx/test/std/depr/depr.c.headers/stdio_h.compile.pass.cpp @@ -6,6 +6,9 @@ // //===----------------------------------------------------------------------===// +// stderr et al are not macros in picolibc's tinystdio. +// XFAIL: LIBCXX-PICOLIBC-FIXME + // test #include Index: libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp =================================================================== --- libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp +++ libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp @@ -11,6 +11,9 @@ // Apple platforms don't provide yet, so these tests fail. // XFAIL: target={{.+}}-apple-{{.+}} +// mbrtoc16 not defined. +// XFAIL: LIBCXX-PICOLIBC-FIXME + // #include Index: libcxx/test/std/experimental/simd/simd.reference/reference_assignment.pass.cpp =================================================================== --- libcxx/test/std/experimental/simd/simd.reference/reference_assignment.pass.cpp +++ libcxx/test/std/experimental/simd/simd.reference/reference_assignment.pass.cpp @@ -11,6 +11,9 @@ // FIXME: Timeouts. // UNSUPPORTED: sanitizer-new-delete +// The machine emulated in tests does not have enough memory for code. +// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME + // // // [simd.reference] Index: libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp =================================================================== --- libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp +++ libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME + // // ostream cerr; Index: libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp =================================================================== --- libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp +++ libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME + // // ostream clog; Index: libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp =================================================================== --- libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp +++ libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME + // // ostream cout; Index: libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp =================================================================== --- libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp +++ libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp @@ -11,6 +11,11 @@ // This test uses iterator types from std::filesystem // XFAIL: availability-filesystem-missing +// std::same_as failed. +// The former was long and the latter was long long. +// Possibly related to "using streamoff = long int" in ios.h. +// XFAIL: LIBCXX-PICOLIBC-FIXME + // template // struct iterator_traits; Index: libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp +++ libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp @@ -9,6 +9,7 @@ // test sized operator delete[] replacement. // UNSUPPORTED: sanitizer-new-delete, c++03, c++11 +// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME // NOTE: Clang does not enable sized-deallocation in C++14 and beyond by // default. It is only enabled when -fsized-deallocation is given. Index: libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp +++ libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp @@ -9,6 +9,7 @@ // test sized operator delete replacement. // UNSUPPORTED: sanitizer-new-delete, c++03, c++11 +// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME // NOTE: Clang does not enable sized-deallocation in C++14 and beyond by // default. It is only enabled when -fsized-deallocation is given. Index: libcxx/test/std/language.support/support.runtime/ctime.timespec.compile.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.runtime/ctime.timespec.compile.pass.cpp +++ libcxx/test/std/language.support/support.runtime/ctime.timespec.compile.pass.cpp @@ -13,6 +13,9 @@ // XFAIL: LIBCXX-AIX-FIXME +// picolibc doesn't define TIME_UTC. +// XFAIL: LIBCXX-PICOLIBC-FIXME + // ::timespec_get is provided by the C library, but it's marked as // unavailable until macOS 10.15 // XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}} Index: libcxx/test/std/numerics/cfenv/cfenv.syn/cfenv.pass.cpp =================================================================== --- libcxx/test/std/numerics/cfenv/cfenv.syn/cfenv.pass.cpp +++ libcxx/test/std/numerics/cfenv/cfenv.syn/cfenv.pass.cpp @@ -6,6 +6,9 @@ // //===----------------------------------------------------------------------===// +// Floating point exceptions are required for the FE_... macros to be defined. +// XFAIL: LIBCXX-PICOLIBC-FIXME + // #include Index: libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp =================================================================== --- libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp +++ libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp @@ -11,6 +11,9 @@ // Apple platforms don't provide yet, so these tests fail. // XFAIL: target={{.+}}-apple-{{.+}} +// mbrtoc16 not defined. +// XFAIL: LIBCXX-PICOLIBC-FIXME + // #include Index: libcxx/test/std/time/time.clock/time.clock.hires/now.pass.cpp =================================================================== --- libcxx/test/std/time/time.clock/time.clock.hires/now.pass.cpp +++ libcxx/test/std/time/time.clock/time.clock.hires/now.pass.cpp @@ -6,6 +6,9 @@ // //===----------------------------------------------------------------------===// +// "unable to find library from dependent library specifier: rt" +// XFAIL: LIBCXX-PICOLIBC-FIXME + // // high_resolution_clock Index: libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp =================================================================== --- libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp +++ libcxx/test/std/time/time.clock/time.clock.file/to_from_sys.pass.cpp @@ -10,6 +10,9 @@ // UNSUPPORTED: availability-filesystem-missing +// "unable to find library from dependent library specifier: rt" +// XFAIL: LIBCXX-PICOLIBC-FIXME + // // // file_clock Index: libcxx/test/std/time/time.clock/time.clock.system/from_time_t.pass.cpp =================================================================== --- libcxx/test/std/time/time.clock/time.clock.system/from_time_t.pass.cpp +++ libcxx/test/std/time/time.clock/time.clock.system/from_time_t.pass.cpp @@ -6,6 +6,9 @@ // //===----------------------------------------------------------------------===// +// "unable to find library from dependent library specifier: rt" +// XFAIL: LIBCXX-PICOLIBC-FIXME + // // system_clock Index: libcxx/test/std/time/time.clock/time.clock.system/now.pass.cpp =================================================================== --- libcxx/test/std/time/time.clock/time.clock.system/now.pass.cpp +++ libcxx/test/std/time/time.clock/time.clock.system/now.pass.cpp @@ -6,6 +6,9 @@ // //===----------------------------------------------------------------------===// +// "unable to find library from dependent library specifier: rt" +// XFAIL: LIBCXX-PICOLIBC-FIXME + // // system_clock Index: libcxx/test/std/time/time.clock/time.clock.system/to_time_t.pass.cpp =================================================================== --- libcxx/test/std/time/time.clock/time.clock.system/to_time_t.pass.cpp +++ libcxx/test/std/time/time.clock/time.clock.system/to_time_t.pass.cpp @@ -6,6 +6,9 @@ // //===----------------------------------------------------------------------===// +// "unable to find library from dependent library specifier: rt" +// XFAIL: LIBCXX-PICOLIBC-FIXME + // // system_clock Index: libcxx/test/std/time/time.point/time.point.nonmember/op_-duration.pass.cpp =================================================================== --- libcxx/test/std/time/time.point/time.point.nonmember/op_-duration.pass.cpp +++ libcxx/test/std/time/time.point/time.point.nonmember/op_-duration.pass.cpp @@ -6,6 +6,9 @@ // //===----------------------------------------------------------------------===// +// "unable to find library from dependent library specifier: rt" +// XFAIL: LIBCXX-PICOLIBC-FIXME + // // time_point Index: libcxx/utils/ci/BOT_OWNERS.txt =================================================================== --- libcxx/utils/ci/BOT_OWNERS.txt +++ libcxx/utils/ci/BOT_OWNERS.txt @@ -10,7 +10,7 @@ N: Linaro Toolchain Working Group E: linaro-toolchain@lists.linaro.org -D: Armv7, Armv8, AArch64 +D: Arm platforms N: LLVM on Power E: powerllvm@ca.ibm.com Index: libcxx/utils/ci/build-picolibc.sh =================================================================== --- /dev/null +++ libcxx/utils/ci/build-picolibc.sh @@ -0,0 +1,109 @@ +#!/usr/bin/env bash +#===----------------------------------------------------------------------===## +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===----------------------------------------------------------------------===## + +# +# This script builds picolibc (https://github.com/picolibc/picolibc) from +# source to facilitate building libc++ against it. +# + +set -e + +PROGNAME="$(basename "${0}")" + +function error() { printf "error: %s\n" "$*" >&2; exit 1; } + +function usage() { +cat < Path to the directory to use for building. + +--install-dir Path to the directory to install the library to. +EOF +} + +while [[ $# -gt 0 ]]; do + case ${1} in + -h|--help) + usage + exit 0 + ;; + --build-dir) + build_dir="${2}" + shift; shift + ;; + --install-dir) + install_dir="${2}" + shift; shift + ;; + --target) + target="${2}" + shift; shift + ;; + *) + error "Unknown argument '${1}'" + ;; + esac +done + +for arg in build_dir install_dir target; do + if [ -z ${!arg+x} ]; then + error "Missing required argument '--${arg//_/-}'" + elif [ "${!arg}" == "" ]; then + error "Argument to --${arg//_/-} must not be empty" + fi +done + + +echo "--- Downloading picolibc" +picolibc_source_dir="${build_dir}/picolibc-source" +picolibc_build_dir="${build_dir}/picolibc-build" +mkdir -p "${picolibc_source_dir}" +mkdir -p "${picolibc_build_dir}" +# Download the version of picolibc that was the latest at the time this script was written. +# The picolibc linker script was changed after version 1.8.2 to work with ld.lld so a +# more recent version is required, which at the time of writing is not yet released. +picolibc_commit="8dd225aa1469c03805617106020d494912c6d265" +curl -L "https://github.com/picolibc/picolibc/archive/${picolibc_commit}.zip" --output "${picolibc_source_dir}/picolibc.zip" +unzip -q "${picolibc_source_dir}/picolibc.zip" -d "${picolibc_source_dir}" +mv "${picolibc_source_dir}/picolibc-${picolibc_commit}"/* "${picolibc_source_dir}" +rm -rf "${picolibc_source_dir}/picolibc-${picolibc_commit}" + +cat < "${picolibc_build_dir}/meson-cross-build.txt" +[binaries] +c = ['${CC:-cc}', '--target=${target}', '-mfloat-abi=soft', '-nostdlib'] +ar = 'llvm-ar' +as = 'llvm-as' +ld = 'lld' +strip = 'llvm-strip' +[host_machine] +system = 'none' +cpu_family = 'arm' +cpu = 'arm' +endian = 'little' +[properties] +skip_sanity_check = true +EOF + +venv_dir="${build_dir}/meson-venv" +python3 -m venv "${venv_dir}" +# Install the version of meson that was the latest at the time this script was written. +"${venv_dir}/bin/pip" install "meson==1.1.1" + +"${venv_dir}/bin/meson" setup \ + -Dincludedir=include -Dlibdir=lib -Dspecsdir=none -Dmultilib=false -Dpicoexit=false \ + --prefix "${install_dir}" \ + --cross-file "${picolibc_build_dir}/meson-cross-build.txt" \ + "${picolibc_build_dir}" \ + "${picolibc_source_dir}" + +"${venv_dir}/bin/meson" install -C "${picolibc_build_dir}" Index: libcxx/utils/ci/buildkite-pipeline.yml =================================================================== --- libcxx/utils/ci/buildkite-pipeline.yml +++ libcxx/utils/ci/buildkite-pipeline.yml @@ -1038,6 +1038,20 @@ limit: 2 timeout_in_minutes: 120 + - label: "Armv7-M picolibc" + command: "libcxx/utils/ci/run-buildbot armv7m-picolibc" + artifact_paths: + - "**/test-results.xml" + - "**/*.abilist" + agents: + queue: "libcxx-builders-linaro-arm" + arch: "aarch64" + retry: + automatic: + - exit_status: -1 # Agent was lost + limit: 2 + timeout_in_minutes: 120 + - group: "AIX" steps: - label: "AIX (32-bit)" Index: libcxx/utils/ci/run-buildbot =================================================================== --- libcxx/utils/ci/run-buildbot +++ libcxx/utils/ci/run-buildbot @@ -621,6 +621,41 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-no-exceptions.cmake" check-runtimes ;; +armv7m-picolibc) + clean + + # To make it easier to get this builder up and running, build picolibc + # from scratch. Anecdotally, the build-picolibc script takes about 16 seconds. + # This could be optimised by building picolibc into the Docker container. + ${MONOREPO_ROOT}/libcxx/utils/ci/build-picolibc.sh \ + --build-dir "${BUILD_DIR}" \ + --install-dir "${INSTALL_DIR}" \ + --target armv7m-none-eabi + + echo "--- Generating CMake" + flags="--sysroot=${INSTALL_DIR}" + ${CMAKE} \ + -S "${MONOREPO_ROOT}/compiler-rt" \ + -B "${BUILD_DIR}/compiler-rt" \ + -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7M-picolibc.cmake" \ + -DCMAKE_C_FLAGS="${flags}" \ + -DCMAKE_CXX_FLAGS="${flags}" \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7M-picolibc.cmake" \ + -DLIBCXX_TEST_CONFIG="armv7m-libc++.cfg.in" \ + -DLIBCXXABI_TEST_CONFIG="armv7m-libc++abi.cfg.in" \ + -DLIBUNWIND_TEST_CONFIG="armv7m-libunwind.cfg.in" \ + -DCMAKE_C_FLAGS="${flags}" \ + -DCMAKE_CXX_FLAGS="${flags}" + + ${NINJA} -vC "${BUILD_DIR}/compiler-rt" install + mv "${BUILD_DIR}/install/lib/armv7m-none-eabi"/* "${BUILD_DIR}/install/lib" + + check-runtimes +;; clang-cl-dll) clean # TODO: Currently, building with the experimental library breaks running Index: libcxx/utils/libcxx/test/features.py =================================================================== --- libcxx/utils/libcxx/test/features.py +++ libcxx/utils/libcxx/test/features.py @@ -110,6 +110,17 @@ name="verify-support", when=lambda cfg: hasCompileFlag(cfg, "-Xclang -verify-ignore-unexpected"), ), + Feature( + name="has-64-bit-atomics", + when=lambda cfg: sourceBuilds( + cfg, + """ + #include + std::atomic_uint64_t x; + int main(int, char**) { (void)x.load(); return 0; } + """, + ), + ), Feature( name="non-lockfree-atomics", when=lambda cfg: sourceBuilds( @@ -215,7 +226,8 @@ #include #include int main(int, char**) { - return 0; + int fd[2]; + return pipe(fd); } """, ), @@ -418,6 +430,19 @@ name="LIBCXX-FREEBSD-FIXME", when=lambda cfg: "__FreeBSD__" in compilerMacros(cfg), ), + Feature( + name="LIBCXX-PICOLIBC-FIXME", + when=lambda cfg: sourceBuilds( + cfg, + """ + #include + #ifndef __PICOLIBC__ + #error not picolibc + #endif + int main(int, char**) { return 0; } + """, + ), + ), ] # Add features representing the build host platform name. Index: libcxxabi/test/configs/armv7m-libc++abi.cfg.in =================================================================== --- /dev/null +++ libcxxabi/test/configs/armv7m-libc++abi.cfg.in @@ -0,0 +1,39 @@ +lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') + +config.substitutions.append(('%{libc-linker-script}', '@CMAKE_INSTALL_PREFIX@/lib/picolibcpp.ld')) + +config.substitutions.append(('%{flags}', '--sysroot=@CMAKE_INSTALL_PREFIX@')) + +config.substitutions.append(('%{compile_flags}', + '-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -I %{libcxx}/test/support -I %{libcxx}/src -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS' +)) +config.substitutions.append(('%{link_flags}', + '-nostdlib -nostdlib++ -L %{lib} -lc++ -lc++abi' + ' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' + ' -T %{libc-linker-script}' + ' -Wl,--defsym=__flash=0x0' + ' -Wl,--defsym=__flash_size=0x400000' + ' -Wl,--defsym=__ram=0x21000000' + ' -Wl,--defsym=__ram_size=0x1000000' + ' -Wl,--defsym=__stack_size=0x1000' +)) +config.substitutions.append(('%{exec}', + 'true' # TODO use qemu-system-arm +)) + +# LIBCXX-PICOLIBC-FIXME is the feature name used to XFAIL the +# initial picolibc failures until they can be properly diagnosed +# and fixed. This allows easier detection of new test failures +# and regressions. Note: New failures should not be suppressed +# using this feature. +config.available_features.add('LIBCXX-PICOLIBC-FIXME') + +import os, site +site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils')) +import libcxx.test.params, libcxx.test.config +libcxx.test.config.configure( + libcxx.test.params.DEFAULT_PARAMETERS, + libcxx.test.features.DEFAULT_FEATURES, + config, + lit_config +) Index: libcxxabi/test/test_demangle.pass.cpp =================================================================== --- libcxxabi/test/test_demangle.pass.cpp +++ libcxxabi/test/test_demangle.pass.cpp @@ -9,6 +9,9 @@ // The demangler does not pass all these tests with the system dylibs on macOS. // XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}} +// This test is too big for most embedded devices. +// XFAIL: LIBCXX-PICOLIBC-FIXME + // https://llvm.org/PR51407 was not fixed in some previously-released // demanglers, which causes them to run into the infinite loop. // UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}} Index: libunwind/test/configs/armv7m-libunwind.cfg.in =================================================================== --- /dev/null +++ libunwind/test/configs/armv7m-libunwind.cfg.in @@ -0,0 +1,32 @@ +lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') + +config.substitutions.append(('%{libc-linker-script}', '@CMAKE_INSTALL_PREFIX@/lib/picolibcpp.ld')) + +config.substitutions.append(('%{flags}', '--sysroot=@CMAKE_INSTALL_PREFIX@')) + +config.substitutions.append(('%{compile_flags}', + '-nostdinc++ -I %{include}' +)) +config.substitutions.append(('%{link_flags}', + '-nostdlib -nostdlib++ -L %{lib} -lunwind' + ' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' + ' -T %{libc-linker-script}' + ' -Wl,--defsym=__flash=0x0' + ' -Wl,--defsym=__flash_size=0x400000' + ' -Wl,--defsym=__ram=0x21000000' + ' -Wl,--defsym=__ram_size=0x1000000' + ' -Wl,--defsym=__stack_size=0x1000' +)) +config.substitutions.append(('%{exec}', + 'true' # TODO use qemu-system-arm +)) + +import os, site +site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils')) +import libcxx.test.params, libcxx.test.config +libcxx.test.config.configure( + libcxx.test.params.DEFAULT_PARAMETERS, + libcxx.test.features.DEFAULT_FEATURES, + config, + lit_config +) Index: mlir/docs/Dialects/ArmSME.md =================================================================== --- mlir/docs/Dialects/ArmSME.md +++ mlir/docs/Dialects/ArmSME.md @@ -1,5 +1,7 @@ # 'ArmSME' Dialect +[TOC] + Basic dialect to target Arm SME architectures This dialect contains the definitions necessary to target Arm SME scalable matrix operations. Index: mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.td =================================================================== --- mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.td +++ mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.td @@ -42,11 +42,45 @@ // ArmSME type definitions //===----------------------------------------------------------------------===// +// FIXME: This allows types that are not SVE vectors, e.g. vector<[16]xi128>. def SVEVector : ScalableVectorOfRankAndLengthAndType< - [1], [16, 8, 4, 2, 1], [I8, I16, I32, I64, I128, F16, BF16, F32, F64]>; + [1], [16, 8, 4, 2, 1], [I8, I16, I32, I64, I128, F16, BF16, F32, F64]> +{ + let summary = "a vector type that matches the size of a SVE vector"; + let description = [{ + Possible vector types: + + Integer elements: + + * `vector<[16]xi8>` + * `vector<[8]xi16>` + * `vector<[4]xi32>` + * `vector<[2]xi64>` + * `vector<[1]xi128>` + + Floating point elements: + + * `vector<[8]xf16>` + * `vector<[8]xbf16>` + * `vector<[4]xf32>` + * `vector<[2]xf64>` + }]; +} def SVEPredicate : ScalableVectorOfRankAndLengthAndType< - [1], [16, 8, 4, 2, 1], [I1]>; + [1], [16, 8, 4, 2, 1], [I1]> +{ + let summary = "a vector type that matches the size of a SVE predicate"; + let description = [{ + Possible vector types: + + * `vector<[16]xi1>` + * `vector<[8]xi1>` + * `vector<[4]xi1>` + * `vector<[2]xi1>` + * `vector<[1]xi1>` + }]; +} #endif // ARMSME Index: mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td =================================================================== --- mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td +++ mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td @@ -43,7 +43,47 @@ def nxnxv2f64 : SMETileType">; def SMETile : AnyTypeOf<[nxnxv16i8, nxnxv8i16, nxnxv4i32, nxnxv2i64, nxnxv1i128, - nxnxv8f16, nxnxv8bf16, nxnxv4f32, nxnxv2f64]>; + nxnxv8f16, nxnxv8bf16, nxnxv4f32, nxnxv2f64], + "a vector type that fits into a SME tile"> +{ + let description = [{ + Possible vector types: + + Integer elements: + + * `vector<[16]x[16]xi8>` + * `vector<[8]x[8]xi16>` + * `vector<[4]x[4]xi32>` + * `vector<[2]x[2]xi64>` + * `vector<[1]x[1]xi128>` + + Floating point elements: + + * `vector<[8]x[8]xf16>` + * `vector<[8]x[8]xbf16>` + * `vector<[4]x[4]xf32>` + * `vector<[2]x[2]xf64>` + }]; +} + +def TileID : AnyTypeOf<[I8, I16, I32, I64, I128], + "an identifier of a virtual tile (of a size) within the ZA storage"> +{ + let description = [{ + The tile ID is an 8, 16, 32, 64, or 128-bit signless integer. The value of + the integer indicates the tile to use, and the bit size indicates the size + of tile. The number of tiles available and the element types of those depend + on the size. This is summarised below: + + | Tile ID Type | Possible Tile IDs | Tile Vector Types | + |--------------|---------------------|-------------------------------------------------------------------------| + | `i8` | 0 | `vector<[16]x[16]xi8>` | + | `i16` | 0 and 1 | `vector<[8]x[8]xi16>`, `vector<[8]x[8]xf16>`, or `vector<[8]x[8]xbf16>` | + | `i32` | 0 to 3 (inclusive) | `vector<[4]x[4]xi32>` or `vector<[4]x[4]xf32>` | + | `i64` | 0 to 7 (inclusive) | `vector<[2]x[2]xi64>` or `vector<[2]x[2]xf64>` | + | `i128` | 0 to 15 (inclusive) | `vector<[1]x[1]xi128>` | + }]; +} // A type constraint that verifies the bitwidth of the scalar integer returned // from 'arm_sme.get_tile_id' matches the element bitwidth of a "virtual tile". @@ -160,7 +200,7 @@ Canonicalization will look through `arm_sme.cast_tile_to_vector` and fold the cast away if it comes from a `arm_sme.cast_vector_to_tile`. }]; - let arguments = (ins AnyTypeOf<[I8, I16, I32, I64, I128]>:$tile_id); + let arguments = (ins TileID:$tile_id); let results = (outs SMETile:$vector); let assemblyFormat = "$tile_id attr-dict `:` type($tile_id) `to` type($vector)"; @@ -196,7 +236,7 @@ the cast away if it comes from a `arm_sme.cast_tile_to_vector`. }]; let arguments = (ins SMETile:$vector); - let results = (outs AnyTypeOf<[I8, I16, I32, I64, I128]>:$tile_id); + let results = (outs TileID:$tile_id); let assemblyFormat = "$vector attr-dict `:` type($vector) `to` type($tile_id)"; let hasCanonicalizeMethod = 1; @@ -232,7 +272,7 @@ ``` }]; - let results = (outs AnyTypeOf<[I8, I16, I32, I64, I128]>:$tile_id); + let results = (outs TileID:$tile_id); let assemblyFormat = "attr-dict `:` type($tile_id)"; } Index: mlir/test/Dialect/ArmSME/invalid.mlir =================================================================== --- mlir/test/Dialect/ArmSME/invalid.mlir +++ mlir/test/Dialect/ArmSME/invalid.mlir @@ -15,7 +15,7 @@ // ----- func.func @arm_sme_cast_tile_to_vector__bad_vector_type_rank_1(%tile_id : i8) -> vector<[16]xi8> { - // expected-error@+1 {{op result #0 must be vector<[16]x[16]xi8> of 8-bit signless integer values or vector<[8]x[8]xi16> of 16-bit signless integer values or vector<[4]x[4]xi32> of 32-bit signless integer values or vector<[2]x[2]xi64> of 64-bit signless integer values or vector<[1]x[1]xi128> of 128-bit signless integer values or vector<[8]x[8]xf16> of 16-bit float values or vector<[8]x[8]xbf16> of bfloat16 type values or vector<[4]x[4]xf32> of 32-bit float values or vector<[2]x[2]xf64> of 64-bit float values, but got 'vector<[16]xi8>'}} + // expected-error@+1 {{op result #0 must be a vector type that fits into a SME tile, but got 'vector<[16]xi8>'}} %0 = arm_sme.cast_tile_to_vector %tile_id : i8 to vector<[16]xi8> return %0 : vector<[16]xi8> } @@ -23,7 +23,7 @@ // ----- func.func @arm_sme_cast_tile_to_vector__bad_vector_type_i4(%tile_id : i8) -> vector<[16]x[16]xi4> { - // expected-error@+1 {{op result #0 must be vector<[16]x[16]xi8> of 8-bit signless integer values or vector<[8]x[8]xi16> of 16-bit signless integer values or vector<[4]x[4]xi32> of 32-bit signless integer values or vector<[2]x[2]xi64> of 64-bit signless integer values or vector<[1]x[1]xi128> of 128-bit signless integer values or vector<[8]x[8]xf16> of 16-bit float values or vector<[8]x[8]xbf16> of bfloat16 type values or vector<[4]x[4]xf32> of 32-bit float values or vector<[2]x[2]xf64> of 64-bit float values, but got 'vector<[16]x[16]xi4>'}} + // expected-error@+1 {{op result #0 must be a vector type that fits into a SME tile, but got 'vector<[16]x[16]xi4>'}} %0 = arm_sme.cast_tile_to_vector %tile_id : i8 to vector<[16]x[16]xi4> return %0 : vector<[16]x[16]xi4> } @@ -31,7 +31,7 @@ // ----- func.func @arm_sme_cast_tile_to_vector__bad_vector_type_non_scalable_dim_0(%tile_id : i8) -> vector<16x[16]xi8> { - // expected-error@+1 {{op result #0 must be vector<[16]x[16]xi8> of 8-bit signless integer values or vector<[8]x[8]xi16> of 16-bit signless integer values or vector<[4]x[4]xi32> of 32-bit signless integer values or vector<[2]x[2]xi64> of 64-bit signless integer values or vector<[1]x[1]xi128> of 128-bit signless integer values or vector<[8]x[8]xf16> of 16-bit float values or vector<[8]x[8]xbf16> of bfloat16 type values or vector<[4]x[4]xf32> of 32-bit float values or vector<[2]x[2]xf64> of 64-bit float values, but got 'vector<16x[16]xi8>'}} + // expected-error@+1 {{op result #0 must be a vector type that fits into a SME tile, but got 'vector<16x[16]xi8>'}} %0 = arm_sme.cast_tile_to_vector %tile_id : i8 to vector<16x[16]xi8> return %0 : vector<16x[16]xi8> } @@ -39,7 +39,7 @@ // ----- func.func @arm_sme_cast_tile_to_vector__bad_vector_type_non_scalable_dim_1(%tile_id : i8) -> vector<[16]x16xi8> { - // expected-error@+1 {{op result #0 must be vector<[16]x[16]xi8> of 8-bit signless integer values or vector<[8]x[8]xi16> of 16-bit signless integer values or vector<[4]x[4]xi32> of 32-bit signless integer values or vector<[2]x[2]xi64> of 64-bit signless integer values or vector<[1]x[1]xi128> of 128-bit signless integer values or vector<[8]x[8]xf16> of 16-bit float values or vector<[8]x[8]xbf16> of bfloat16 type values or vector<[4]x[4]xf32> of 32-bit float values or vector<[2]x[2]xf64> of 64-bit float values, but got 'vector<[16]x16xi8>'}} + // expected-error@+1 {{op result #0 must be a vector type that fits into a SME tile, but got 'vector<[16]x16xi8>'}} %0 = arm_sme.cast_tile_to_vector %tile_id : i8 to vector<[16]x16xi8> return %0 : vector<[16]x16xi8> } @@ -47,7 +47,7 @@ // ----- func.func @arm_sme_cast_tile_to_vector_bad_shape(%tile_id : i8) -> vector<[4]x[16]xi8> { - // expected-error@+1 {{op result #0 must be vector<[16]x[16]xi8> of 8-bit signless integer values or vector<[8]x[8]xi16> of 16-bit signless integer values or vector<[4]x[4]xi32> of 32-bit signless integer values or vector<[2]x[2]xi64> of 64-bit signless integer values or vector<[1]x[1]xi128> of 128-bit signless integer values or vector<[8]x[8]xf16> of 16-bit float values or vector<[8]x[8]xbf16> of bfloat16 type values or vector<[4]x[4]xf32> of 32-bit float values or vector<[2]x[2]xf64> of 64-bit float values, but got 'vector<[4]x[16]xi8>'}} + // expected-error@+1 {{op result #0 must be a vector type that fits into a SME tile, but got 'vector<[4]x[16]xi8>'}} %0 = arm_sme.cast_tile_to_vector %tile_id : i8 to vector<[4]x[16]xi8> return %0 : vector<[4]x[16]xi8> } @@ -67,7 +67,7 @@ // ----- func.func @arm_sme_cast_vector_to_tile__bad_rank_1d(%vector : vector<[16]xi8>) -> i8 { - // expected-error@+1 {{op operand #0 must be vector<[16]x[16]xi8> of 8-bit signless integer values or vector<[8]x[8]xi16> of 16-bit signless integer values or vector<[4]x[4]xi32> of 32-bit signless integer values or vector<[2]x[2]xi64> of 64-bit signless integer values or vector<[1]x[1]xi128> of 128-bit signless integer values or vector<[8]x[8]xf16> of 16-bit float values or vector<[8]x[8]xbf16> of bfloat16 type values or vector<[4]x[4]xf32> of 32-bit float values or vector<[2]x[2]xf64> of 64-bit float values, but got 'vector<[16]xi8>'}} + // expected-error@+1 {{op operand #0 must be a vector type that fits into a SME tile, but got 'vector<[16]xi8>'}} %0 = arm_sme.cast_vector_to_tile %vector : vector<[16]xi8> to i8 return %0 : i8 } @@ -79,7 +79,7 @@ // ----- func.func @arm_sme_get_tile_id__bad_type() -> i1 { - // expected-error@+1 {{op result #0 must be 8-bit signless integer or 16-bit signless integer or 32-bit signless integer or 64-bit signless integer or 128-bit signless integer}} + // expected-error@+1 {{op result #0 must be an identifier of a virtual tile (of a size) within the ZA storage}} %0 = arm_sme.get_tile_id : i1 return %0 : i1 } @@ -200,7 +200,7 @@ func.func @arm_sme_outerproduct__bad_result_type(%vecA: vector<[2]xi16>, %vecB: vector<[2]xi16>) -> vector<[2]x[2]xi16> { - // expected-error@+1 {{op result #0 must be vector<[16]x[16]xi8> of 8-bit signless integer values or vector<[8]x[8]xi16> of 16-bit signless integer values or vector<[4]x[4]xi32> of 32-bit signless integer values or vector<[2]x[2]xi64> of 64-bit signless integer values or vector<[1]x[1]xi128> of 128-bit signless integer values or vector<[8]x[8]xf16> of 16-bit float values or vector<[8]x[8]xbf16> of bfloat16 type values or vector<[4]x[4]xf32> of 32-bit float values or vector<[2]x[2]xf64> of 64-bit float values, but got 'vector<[2]x[2]xi16>'}} + // expected-error@+1 {{op result #0 must be a vector type that fits into a SME tile, but got 'vector<[2]x[2]xi16>'}} %0 = arm_sme.outerproduct %vecA, %vecB : vector<[2]xi16>, vector<[2]xi16> return %0 : vector<[2]x[2]xi16> }