diff --git a/Bitcode/Benchmarks/Halide/CMakeLists.txt b/Bitcode/Benchmarks/Halide/CMakeLists.txt index 06f863096..34126c0c7 100644 --- a/Bitcode/Benchmarks/Halide/CMakeLists.txt +++ b/Bitcode/Benchmarks/Halide/CMakeLists.txt @@ -10,11 +10,11 @@ if(NOT MSVC) endif() macro(test_img_input img) - llvm_test_run(%S/../images/${img}.bytes ${ARGN} %S/${img}_out.bytes) + llvm_test_run(%S/images/${img}.bytes ${ARGN} %S/${img}_out.bytes) llvm_test_verify(%b/${FPCMP} %S/output/${img}_out.bytes %S/${img}_out.bytes) endmacro() macro(test_img_data target img) - llvm_test_data(${target} ../images/${img}.bytes) + llvm_test_data(${target} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.. images/${img}.bytes) llvm_test_data(${target} output/${img}_out.bytes) endmacro() diff --git a/Fortran/gfortran/regression/DisabledFiles.cmake b/Fortran/gfortran/regression/DisabledFiles.cmake index a97def389..ace6de0e2 100644 --- a/Fortran/gfortran/regression/DisabledFiles.cmake +++ b/Fortran/gfortran/regression/DisabledFiles.cmake @@ -1052,6 +1052,7 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS io_real_boz2.f90 io_real_boz_4.f90 io_real_boz_5.f90 + namelist_96.f90 # real data for integer NAMELIST input no_unit_error_1.f90 pointer_check_10.f90 pointer_remapping_6.f08 @@ -1301,6 +1302,8 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS pr95614_2.f90 pr95882_3.f90 recursive_check_3.f90 + restricted_expression_2.f90 + restricted_expression_3.f90 return_1.f90 size_kind_3.f90 string_3.f90 diff --git a/SingleSource/UnitTests/AArch64/acle-fmv-features.c b/SingleSource/UnitTests/AArch64/acle-fmv-features.c index 2175d446a..d7b36dbbb 100644 --- a/SingleSource/UnitTests/AArch64/acle-fmv-features.c +++ b/SingleSource/UnitTests/AArch64/acle-fmv-features.c @@ -15,58 +15,58 @@ static bool safe_try_feature(bool (*try_feature)(void)); static bool any_fails = false; #if __HAVE_FUNCTION_MULTI_VERSIONING -#define CHECK(X, TARGET_GUARD, BODY) \ +#define CHECK(FN_NAME_SUFFIX, FMV_FEATURE, TARGET_GUARD, BODY) \ __attribute__((target(#TARGET_GUARD))) \ - static bool try_##X(void) { \ + static bool try_##FN_NAME_SUFFIX(void) { \ do \ BODY \ while (0); \ return true; \ } \ - __attribute__((target_version(#X))) \ - static void check_##X(void) { \ - printf("%s\n", #X); \ + __attribute__((target_version(#FMV_FEATURE))) \ + static void check_##FN_NAME_SUFFIX(void) { \ + printf("%s\n", #FMV_FEATURE); \ fflush(stdout); \ - if (!safe_try_feature(try_##X)) { \ + if (!safe_try_feature(try_##FN_NAME_SUFFIX)) { \ printf("\tFAIL\n"); \ any_fails = true; \ } \ } \ __attribute__((target_version("default"))) \ - static void check_##X(void) { \ - printf("%s\n", #X); \ + static void check_##FN_NAME_SUFFIX(void) { \ + printf("%s\n", #FMV_FEATURE); \ fflush(stdout); \ - if (safe_try_feature(try_##X)) { \ + if (safe_try_feature(try_##FN_NAME_SUFFIX)) { \ printf("\tUPASS\n"); \ any_fails = true; \ } \ } #else -#define CHECK(X, TARGET_GUARD, BODY) \ - static void check_##X(void) { \ - printf("%s\n", #X); \ +#define CHECK(FN_NAME_SUFFIX, FMV_FEATURE, TARGET_GUARD, BODY) \ + static void check_##FN_NAME_SUFFIX(void) { \ + printf("%s\n", #FMV_FEATURE); \ } #endif -CHECK(flagm, flagm, { +CHECK(flagm, flagm, flagm, { asm volatile ( "cfinv" "\n" "cfinv" "\n" ); }) -CHECK(flagm2, arch=armv8.5-a, { +CHECK(flagm2, flagm2, arch=armv8.5-a, { asm volatile ( "axflag" "\n" "xaflag" "\n" ); }) -CHECK(dotprod, dotprod, { +CHECK(dotprod, dotprod, dotprod, { asm volatile ( "udot v0.4S,v1.16B,v2.16B" : : : "v0" ); }) -CHECK(sha3, sha3, { +CHECK(sha3, sha3, sha3, { asm volatile ( "fmov d0, #0" "\n" "fmov d1, #0" "\n" @@ -74,36 +74,29 @@ CHECK(sha3, sha3, { : : : "v0" ); }) -CHECK(rdm, rdm, { +CHECK(rdm, rdm, rdm, { asm volatile ( "sqrdmlah s0, s1, s2" : : : "s0" ); }) -CHECK(lse, lse, { +CHECK(lse, lse, lse, { uint64_t pointee = 0; asm volatile ( "swp xzr, xzr, [%[pointee]]" : : [pointee]"r"(&pointee) ); }) -CHECK(sha2, sha2, { +CHECK(sha2, sha2, sha2, { asm volatile ( "fmov d0, #0" "\n" "fmov d1, #0" "\n" "sha256h q0, q0, v0.4s" "\n" + "sha1h s0, s0" "\n" : : : "v0" ); }) -CHECK(sha1, sha1, { - asm volatile ( - "fmov s0, #0" "\n" - // FIXME: sha1h is under +sha2 in clang, and +sha1 doesn't exist yet. - ".inst 0x5e280800" "\n" // sha1h s0, s0 - : : : "v0" - ); -}) -CHECK(aes, aes, { +CHECK(aes, aes, aes, { asm volatile ( "fmov d0, #0" "\n" "fmov d1, #0" "\n" @@ -111,89 +104,88 @@ CHECK(aes, aes, { : : : "v0" ); }) -CHECK(pmull, aes, { +CHECK(pmull, pmull, aes, { asm volatile ( "fmov d0, #0" "\n" "pmull v0.1q, v0.1d, v0.1d" "\n" : : : "v0" ); }) -CHECK(rcpc, rcpc, { +CHECK(rcpc, rcpc, rcpc, { int x; asm volatile ( "ldaprb w0, [%0]" : : "r" (&x) : "w0" ); }) -CHECK(rcpc2, rcpc2, { +CHECK(rcpc2, rcpc2, arch=armv8.4-a, { int x; asm volatile ( "mov x1, %0" "\n" - // FIXME: rcpc2 instructions are under +rcpc-immo in clang, and not +rcpc2. - ".inst 0x19400020" // ldapurb w0, [x1] - : : "r" (&x) : "w0" + "ldapurb w0, [x1]" "\n" + : : "r" (&x) : "w0", "x1" ); }) -CHECK(fcma, fcma, { +CHECK(fcma, fcma, fcma, { asm volatile ( "fmov d0, #0" "\n" "fcadd v0.2s, v0.2s, v0.2s, #90" "\n" : : : "v0" ); }) -CHECK(jscvt, jscvt, { +CHECK(jscvt, jscvt, jscvt, { asm volatile ( "fmov d0, #0" "\n" "fjcvtzs w1, d0" "\n" : : : "w1", "d0" ); }) -CHECK(dpb, arch=armv8.2-a, { +CHECK(dpb, dpb, arch=armv8.2-a, { int x; asm volatile ( "dc cvap, %0" : : "r" (&x) ); }) -CHECK(dpb2, arch=armv8.5-a, { +CHECK(dpb2, dpb2, arch=armv8.5-a, { int x; asm volatile ( "dc cvadp, %0" : : "r" (&x) ); }) -CHECK(bf16, bf16, { +CHECK(bf16, bf16, bf16, { asm volatile ( "bfdot v0.4S,v1.8H,v2.8H" : : : "v0" ); }) -CHECK(i8mm, i8mm, { +CHECK(i8mm, i8mm, i8mm, { asm volatile ( "sudot v0.4S,v1.16B,v2.4B[0]" : : : "v0" ); }) -CHECK(dit, dit, { +CHECK(dit, dit, dit, { asm volatile ( "msr DIT, x0" : : : "x0" ); }) -CHECK(fp16, fp16, { +CHECK(fp16, fp16, fp16, { asm volatile ( "fmov h0, #0" : : : "v0" ); }) -CHECK(ssbs2, ssbs, { +CHECK(ssbs2, ssbs2, ssbs, { asm volatile ( "mrs x0, SSBS" "\n" "msr SSBS, x0" "\n" : : : "x0" ); }) -CHECK(bti, bti, { +CHECK(bti, bti, bti, { // The only test for this requires reading a register that is only // accessible to EL1. #ifdef __linux__ @@ -214,34 +206,162 @@ CHECK(bti, bti, { // TODO: implement me on your platform to fix this test! #endif }) -CHECK(simd, simd, { +CHECK(simd, simd, simd, { asm volatile ( "mov v0.B[0], w0" : : : ); }) -CHECK(fp, fp, { +CHECK(fp, fp, fp, { asm volatile ( "fmov s0, #0" : : : "v0" ); }) -CHECK(crc, crc, { +CHECK(crc, crc, crc, { asm volatile ( "crc32b wzr, wzr, wzr"); }) -CHECK(sme, sme, { +CHECK(sme, sme, sme, { asm volatile ( "rdsvl x0, #1" : : : "x0" ); }) -CHECK(sme2, sme2, { +CHECK(sme2, sme2, sme2, { asm volatile ( "smstart za" "\n" "zero { zt0 }" "\n" "smstop za" "\n" ); }) +CHECK(ls64, ls64, ls64, { + long data[8]; + asm volatile ( + "ld64b x0, [%0]" "\n" + "st64b x0, [%0]" "\n" + "st64bv x8, x0, [%0]" "\n" + "st64bv0 x8, x0, [%0]" "\n" + : + : "r" (data) + : "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "memory" + ); +}) +CHECK(f32mm, f32mm, f32mm, { + asm volatile ( + "fmmla z0.s, z1.s, z2.s" + : : : "v0" + ); +}) +CHECK(f64mm, f64mm, f64mm, { + asm volatile ( + "fmmla z0.d, z1.d, z2.d" + : : : "v0" + ); +}) +CHECK(fp16fml, fp16fml, fp16fml, { + asm volatile ( + "fmlal v0.2s, v1.2h, v2.2h" + : : : "v0" + ); +}) +CHECK(frintts, frintts, arch=armv8.5-a, { + asm volatile ( + "frint32z s0, s1" + : : : "v0" + ); +}) +CHECK(predres, predres, predres, { + asm volatile ( + "cfp rctx, x0" "\n" + "dvp rctx, x1" "\n" + "cpp rctx, x2" "\n" + ); +}) +CHECK(rcpc3, rcpc3, rcpc3, { + long x; + asm volatile ( + "stilp wzr, wzr, [%0]" + : : "r" (&x) : "memory" + ); +}) +CHECK(rng, rng, rng, { + asm volatile ( + "mrs x0, rndr" "\n" + "mrs x1, rndrrs" "\n" + : : : "x0", "x1" + ); +}) +CHECK(sve, sve, sve, { + asm volatile ( + "fadda s0, p7, s0, z31.s" + : : : "v0" + ); +}) +CHECK(sve2, sve2, sve2, { + asm volatile ( + "match p15.b, p7/z, z0.b, z1.b" + : : : "p15", "cc" + ); +}) +CHECK(sve2_bitperm, sve2-bitperm, sve2-bitperm, { + asm volatile ( + "bext z0.s, z1.s, z2.s" + : : : "z0" + ); +}) +CHECK(sve2_sha3, sve2-sha3, sve2-sha3, { + asm volatile ( + "rax1 z0.d, z1.d, z2.d" + : : : "z0" + ); +}) +CHECK(sve2_sm4, sve2-sm4, sve2-sm4, { + asm volatile ( + "sm4e z0.s, z0.s, z2.s" + : : : "z0" + ); +}) +CHECK(wfxt, wfxt, wfxt, { + asm volatile ( + "wfet x0" "\n" + "wfit x1" "\n" + ); +}) +CHECK(sb, sb, sb, { + asm volatile ("sb"); +}) +CHECK(sm4, sm4, sm4, { + asm volatile ( + "sm4e v0.4s, v1.4s" + : : : "v0" + ); +}) +CHECK(sme_f64f64, sme-f64f64, sme-f64f64, { + asm volatile ( + "fmops za0.d, p0/m, p0/m, z0.d, z0.d" + : : : "za" + ); +}) +CHECK(sme_i16i64, sme-i16i64, sme-i16i64, { + asm volatile ( + "smopa za0.d, p0/m, p0/m, z0.h, z0.h" + : : : "za" + ); +}) +CHECK(mops, mops, mops, { + long dst[64]; + long src[64]; + size_t n = 32; + long *to = dst; + long *from = src; + asm volatile ( + "cpyfp [%0]!, [%1]!, %2!" "\n" + "cpyfm [%0]!, [%1]!, %2!" "\n" + "cpyfe [%0]!, [%1]!, %2!" "\n" + : "+r" (to), "+r" (from), "+r" (n) + : : "cc", "memory" + ); +}) static bool safe_try_feature(bool (*try_feature)(void)) { int child = fork(); @@ -263,7 +383,6 @@ int main(int, const char **) { check_rdm(); check_lse(); check_sha2(); - check_sha1(); check_aes(); check_pmull(); check_rcpc(); @@ -283,6 +402,25 @@ int main(int, const char **) { check_crc(); check_sme(); check_sme2(); + check_ls64(); + check_f32mm(); + check_f64mm(); + check_fp16fml(); + check_frintts(); + check_predres(); + check_rcpc3(); + check_rng(); + check_sve(); + check_sve2(); + check_sve2_bitperm(); + check_sve2_sha3(); + check_sve2_sm4(); + check_wfxt(); + check_sb(); + check_sm4(); + check_sme_f64f64(); + check_sme_i16i64(); + check_mops(); return any_fails ? -1 : 0; } diff --git a/SingleSource/UnitTests/AArch64/acle-fmv-features.reference_output b/SingleSource/UnitTests/AArch64/acle-fmv-features.reference_output index 003c65ddf..f00fba43a 100644 --- a/SingleSource/UnitTests/AArch64/acle-fmv-features.reference_output +++ b/SingleSource/UnitTests/AArch64/acle-fmv-features.reference_output @@ -5,7 +5,6 @@ sha3 rdm lse sha2 -sha1 aes pmull rcpc @@ -25,4 +24,23 @@ fp crc sme sme2 +ls64 +f32mm +f64mm +fp16fml +frintts +predres +rcpc3 +rng +sve +sve2 +sve2-bitperm +sve2-sha3 +sve2-sm4 +wfxt +sb +sm4 +sme-f64f64 +sme-i16i64 +mops exit 0 diff --git a/tools/fpcmp.c b/tools/fpcmp.c index 3d026e24d..a0bab1d1f 100644 --- a/tools/fpcmp.c +++ b/tools/fpcmp.c @@ -247,6 +247,27 @@ char *load_file(const char *path, long *size_out) { return data; } +static bool contains_non_printable_characters(const char *data) { + size_t len = strlen(data); + for (size_t i = 0; i < len; ++i) + if (!isprint(data[i]) && !isspace(data[i])) + return true; + return false; +} + +static void dump_input(const char *label, const char *data) { + if (contains_non_printable_characters(data)) { + fprintf(stderr, "\n%s: Contains binary data.\n", label); + } else { + fprintf(stderr, "\n%s:\n%s", label, data); + } +} + +static void dump_inputs(const char *data_a, const char *data_b) { + dump_input("Input 1", data_a); + dump_input("Input 2", data_b); +} + int diff_file(const char *path_a, const char *path_b, bool parse_fp, double absolute_tolerance, double relative_tolerance, bool ignore_whitespace) { @@ -356,6 +377,7 @@ int diff_file(const char *path_a, const char *path_b, bool parse_fp, fprintf(stderr, "%s: Comparison failed, textual difference between '%c' and '%c'\n", g_program, F1P[0], F2P[0]); + dump_inputs(data_a, data_b); free(data_a); free(data_b); return 1; @@ -364,6 +386,7 @@ int diff_file(const char *path_a, const char *path_b, bool parse_fp, fprintf(stderr, "%s: Comparison failed, unexpected end of one of the files\n", g_program); + dump_inputs(data_a, data_b); free(data_a); free(data_b); return 1;