Skip to content
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

This change updates support for target-specific code. #615

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

jbowler
Copy link
Contributor

@jbowler jbowler commented Oct 9, 2024

The change removes the need for build configuration of target specific
code such as SIMD enhancements.

The extensible framework is based on checks in the new file named
pngtarget.h and allows per target description of requirements and
capabilities using macros with the prefix PNG_TARGET_. These macros are
interpreted by the core libpng code in a target independent way.

The PNG_TARGET_ prefixed macros describe the target specific
implementation and document how to include it. The actual inclusion of
the code is done, at present, by a single target independent core file
named pngsimd.c.

This approach ensures that no special configuration in the build system
is required on any system. It is not required on a system which is
compiling for the build host where we can reasonably assume that the
compiler is correctly set up. Neither is it required for cross builds
so long as the toolchain is correctly set up. In this case the
toolchain means the cross build system and any ancilliary programs it
requires.

More details of the implementation are included in the source files
named pngtarget.h and pngsimd.c. These files document in C comments how
additional target specific code might be added.

The changes consist primarily of movement of target specific code from
the core libpng source files to the existing target specific
subdirectories such as the ones named intel and arm. This isolates the
code into the corresponding subdirectory and eliminates the requirement
for changes across the libpng structure.

As part of this the ARM processor NEON instruction set specific palette
to RGB code has been generalised to allow implementation in other
architectures. The resultant updated version of the original (ARM Ltd)
implementation has been moved to the subdirectory named arm.

In addition some selected changes have been included to allow testing
with higher warning levels than the typical compiler defaults.

Signed-off-by: John Bowler [email protected]

@jbowler
Copy link
Contributor Author

jbowler commented Oct 9, 2024

As best I understand them this PR incorporates all your required changes. It doesn't change the actual code, just the comments, commit messages and so on.

@jbowler jbowler marked this pull request as draft October 10, 2024 15:19
@jbowler
Copy link
Contributor Author

jbowler commented Oct 10, 2024

In fact this is incomplete; the Loongson support isn't there and I can't do that. It needs a non-US person.

hardware.old/check.h Outdated Show resolved Hide resolved
@jbowler jbowler force-pushed the 20241009-target-specific-code branch from 426ec97 to 4793eca Compare October 10, 2024 16:57
The change removes the need for build configuration of target specific
code such as SIMD enhancements.

The extensible framework is based on checks in the new file named
pngtarget.h and allows per target description of requirements and
capabilities using macros with the prefix PNG_TARGET_.  These macros are
interpreted by the core libpng code in a target independent way.

The PNG_TARGET_ prefixed macros describe the target specific
implementation and document how to include it.  The actual inclusion of
the code is done, at present, by a single target independent core file
named pngsimd.c.

This approach ensures that no special configuration in the build system
is required on any system.  It is not required on a system which is
compiling for the build host where we can reasonably assume that the
compiler is correctly set up.  Neither is it required for cross builds
so long as the toolchain is correctly set up.  In this case the
toolchain means the cross build system and any ancilliary programs it
requires.

More details of the implementation are included in the source files
named pngtarget.h and pngsimd.c.  These files document in C comments how
additional target specific code might be added.

The changes consist primarily of movement of target specific code from
the core libpng source files to the existing target specific
subdirectories such as the ones named intel and arm.  This isolates the
code into the corresponding subdirectory and eliminates the requirement
for changes across the libpng structure.

As part of this the ARM processor NEON instruction set specific palette
to RGB code has been generalised to allow implementation in other
architectures.  The resultant updated version of the original (ARM Ltd)
implementation has been moved to the subdirectory named arm.

In addition some selected changes have been included to allow testing
with higher warning levels than the typical compiler defaults.

Signed-off-by: John Bowler <[email protected]>
@jbowler jbowler force-pushed the 20241009-target-specific-code branch from 4793eca to b1626b7 Compare October 10, 2024 17:36
@jbowler jbowler marked this pull request as ready for review October 10, 2024 17:37
Copy link
Member

@ctruta ctruta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big honking commit approved 👍

@ctruta ctruta merged commit ed68998 into pnggroup:libpng18 Oct 10, 2024
1 check passed
@jbowler jbowler deleted the 20241009-target-specific-code branch October 10, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants