-
-
Notifications
You must be signed in to change notification settings - Fork 308
Add a fallback to ALIGNED_ macro for other compilers #1820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe changes involve the Changes
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
zbuild.h (1)
204-204: Enhance the TODO comment with more contextThe TODO comment could be more descriptive to help future maintainers understand when and why they might need to define
ALIGNED_for their compiler.Consider updating it to:
-/* TODO: Define ALIGNED_ for your compiler */ +/* TODO: Define ALIGNED_(x) for your compiler if it requires specific alignment directives for SSE/AVX optimizations */
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
zbuild.h(1 hunks)
🔇 Additional comments (1)
zbuild.h (1)
203-205: LGTM! The fallback implementation is safe and appropriate
The empty fallback for ALIGNED_ is correct when the compiler doesn't support or require specific alignment directives. This is particularly suitable for compilers without SSE/AVX support where strict alignment isn't necessary.
Let's verify the macro usage to ensure the fallback is safe:
|
@winspool Just wondering, what compiler is hitting this? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1820 +/- ##
===========================================
- Coverage 32.19% 32.12% -0.07%
===========================================
Files 67 67
Lines 5752 5752
Branches 1237 1237
===========================================
- Hits 1852 1848 -4
Misses 3644 3644
- Partials 256 260 +4 ☔ View full report in Codecov by Sentry. |
OpenWatcom v2 on linux TODO:
Yes, all together the result is a lot slower as possible, |
My https://github.com/winspool/_build.git I build with autotools, which results in Btw, cross-compiling on linux for _WIN32 fails, |
|
Proposed additional portability-patches to allow OpenWatcom and tcc to compile zlib-ng: Use a fallback for cpuid related functions: Use a fallback for memalign: When patch 0002 is an acceptable style, i can update This will also fix cross compiling for windows (tested with |
Forgot to mention, that tcc is also affected |
|
Generally I'm not against adding support for new compilers, but it seems these compilers target "configurations" that are not highest priority for zlib-ng as most of the optimisations get disabled. |
Great. I usually use
Get it runing without optimization is only the first step. The |
|
Please give me some infos, what i can do, Is an update to this simple PR needed? |
|
I didn't looked at the CodeCov integration yet, |
Adding support for one compiler per pull request is usually good idea as it makes reviewing the necessary changes easier... If two or more compilers benefit for overlapping changes, then adding the overlapping part first as own commit in PR makes it clear what changes overlap and what are specific to each compiler. If just the overlapping part doesn't result in successful build, then combine it with enough code for one compiler configuration that results in successful build (smaller initial commit is better). We allow incremental patches that span multiple pull requests, but generally single PR shouldn't break the build for any configuration, or revert changes in previous PR in same patch series. Reverting older changes is acceptable as long as the older change was clearly bad or it is no longer needed due to other changes committed in between. As far as I know latest stable version of Watcom compiler is quite old (it was released the same day my older girl was born), but I haven't yet checked what newer features are planned for the current beta version or when the feature freeze is for that branch. I know almost nothing about Tiny C Compiler, so can't comment on that yet... |
|
Patch 3 doesn't look quite right, but the first two have nothing seriously bad that I can notice... Clang as far as I know defines |
|
In general, we don't support this compiler, but I am not against merging patches like this one that really has no downside. |
Thanks. |
|
Curiously this macro was causing problems for me with CMake, GCC, and PowerPC. I never got to the bottom of it, though. We actually do need alignment for VMX, otherwise you get the fun side effect of a load happening at the next alignment boundary, silently. |
@KungFuJesus I am a little uncertain about this comment, so I hope you can clarify; Is this a Pro/Con on this PR, or a suggestion for later, or just a comment? |
Mostly just a comment. The issue likes somewhere in CMake, I think. There's a pending PR for PPC that suddenly breaks the machinery around how we specify this macro: #1690 |
Ah #1690, now I get it 👍 |
Since the affectes compiler does not support SSE/AVX,
a bigger alignment is not needed.
Summary by CodeRabbit
New Features
ALIGNED_macro to enhance compatibility with various compilers.Bug Fixes