From 4aa302d66fdc01a2ca63a900d7e2ba75e15d7a29 Mon Sep 17 00:00:00 2001 From: Matthew Craven Date: Sat, 16 Sep 2023 09:47:26 -0400 Subject: [PATCH 1/5] Delete cabal.project It seems to no longer do anything useful, and it also prevents CI from detecting that include/bytestring-cpp-macros.h was not getting picked up by `cabal sdist`. --- cabal.project | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 cabal.project diff --git a/cabal.project b/cabal.project deleted file mode 100644 index 068f4f22d..000000000 --- a/cabal.project +++ /dev/null @@ -1,3 +0,0 @@ -packages: . -tests: True -benchmarks: True From a480aa504bd00c0ee96bfea23feb622a5c7ea2be Mon Sep 17 00:00:00 2001 From: Matthew Craven Date: Sat, 16 Sep 2023 18:33:18 -0400 Subject: [PATCH 2/5] Add bytestring-cpp-macros.h to install-includes In particular, this ensures that `cabal sdist` grabs it. --- bytestring.cabal | 1 + 1 file changed, 1 insertion(+) diff --git a/bytestring.cabal b/bytestring.cabal index 486315000..e58c4700c 100644 --- a/bytestring.cabal +++ b/bytestring.cabal @@ -155,6 +155,7 @@ library include-dirs: include includes: fpstring.h install-includes: fpstring.h + bytestring-cpp-macros.h test-suite bytestring-tests type: exitcode-stdio-1.0 From 5267a0a365e5b51c100aad18ac30cf0aab10e0a3 Mon Sep 17 00:00:00 2001 From: Matthew Craven Date: Sat, 16 Sep 2023 21:39:46 -0400 Subject: [PATCH 3/5] Add bytestring-cpp-macros.h to includes The cabal documentation claims as a pre-requisite for its usability "when compiling the package itself." It's unclear if this is really true, but there is no harm done in adding bytestring-cpp-macros.h there just in case. --- bytestring.cabal | 1 + 1 file changed, 1 insertion(+) diff --git a/bytestring.cabal b/bytestring.cabal index e58c4700c..40fc02596 100644 --- a/bytestring.cabal +++ b/bytestring.cabal @@ -154,6 +154,7 @@ library include-dirs: include includes: fpstring.h + bytestring-cpp-macros.h install-includes: fpstring.h bytestring-cpp-macros.h From 078bd5d797124145c7bad8db7fcf26d54cad5178 Mon Sep 17 00:00:00 2001 From: Matthew Craven Date: Sun, 17 Sep 2023 18:24:01 -0400 Subject: [PATCH 4/5] Experiment: When is __ARM_FEATURE_UNALIGNED visible? --- bytestring.cabal | 3 +-- cbits/fpstring.c | 4 ++++ include/bytestring-cpp-macros.h | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bytestring.cabal b/bytestring.cabal index 40fc02596..69066eeea 100644 --- a/bytestring.cabal +++ b/bytestring.cabal @@ -66,7 +66,7 @@ Tested-With: GHC==9.4.1, GHC==8.0.2 Build-Type: Simple Cabal-Version: >= 1.10 -extra-source-files: README.md Changelog.md +extra-source-files: README.md Changelog.md include/bytestring-cpp-macros.h source-repository head type: git @@ -154,7 +154,6 @@ library include-dirs: include includes: fpstring.h - bytestring-cpp-macros.h install-includes: fpstring.h bytestring-cpp-macros.h diff --git a/cbits/fpstring.c b/cbits/fpstring.c index 1c363e992..553e362e5 100644 --- a/cbits/fpstring.c +++ b/cbits/fpstring.c @@ -46,6 +46,10 @@ #define USE_SIMD_COUNT #endif +#if defined(__ARM_FEATURE_UNALIGNED) +#warning "How about in C code?" +#endif + /* copy a string in reverse */ void fps_reverse(unsigned char *q, unsigned char *p, size_t n) { p += n-1; diff --git a/include/bytestring-cpp-macros.h b/include/bytestring-cpp-macros.h index e2008e5e2..264b7b71b 100644 --- a/include/bytestring-cpp-macros.h +++ b/include/bytestring-cpp-macros.h @@ -2,6 +2,9 @@ #error "bytestring-cpp-macros.h does not work in C code yet" #endif +#if defined(__ARM_FEATURE_UNALIGNED) +#warning "Is this macro ever actually visible to Haskell code?" +#endif #if defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH) \ || ((defined(arm_HOST_ARCH) || defined(aarch64_HOST_ARCH)) \ From 4fafb5e4799dedcab6ccfe4e56abe16aaa0ecfcd Mon Sep 17 00:00:00 2001 From: Matthew Craven Date: Wed, 20 Sep 2023 04:19:46 -0400 Subject: [PATCH 5/5] Remove __ARM_FEATURE_UNALIGNED experiment/warnings It seems this macro is never visible in Haskell code. But with real unaligned primops in the near future, it doesn't seem worth messing with. --- cbits/fpstring.c | 4 ---- include/bytestring-cpp-macros.h | 3 --- 2 files changed, 7 deletions(-) diff --git a/cbits/fpstring.c b/cbits/fpstring.c index 553e362e5..1c363e992 100644 --- a/cbits/fpstring.c +++ b/cbits/fpstring.c @@ -46,10 +46,6 @@ #define USE_SIMD_COUNT #endif -#if defined(__ARM_FEATURE_UNALIGNED) -#warning "How about in C code?" -#endif - /* copy a string in reverse */ void fps_reverse(unsigned char *q, unsigned char *p, size_t n) { p += n-1; diff --git a/include/bytestring-cpp-macros.h b/include/bytestring-cpp-macros.h index 264b7b71b..e2008e5e2 100644 --- a/include/bytestring-cpp-macros.h +++ b/include/bytestring-cpp-macros.h @@ -2,9 +2,6 @@ #error "bytestring-cpp-macros.h does not work in C code yet" #endif -#if defined(__ARM_FEATURE_UNALIGNED) -#warning "Is this macro ever actually visible to Haskell code?" -#endif #if defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH) \ || ((defined(arm_HOST_ARCH) || defined(aarch64_HOST_ARCH)) \