Skip to content

Fix Clang model bug, improve SSE intrinsics code and add tests for q_math transform functions #1452

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

Merged
merged 5 commits into from
Dec 5, 2024

Conversation

slipher
Copy link
Member

@slipher slipher commented Dec 2, 2024

No description provided.

I've kept some of them which are unused but are needed to have a
complete API, such as TransInsTranslation. Removed ones are either about
multiplying by an inverse, or specify a rotation in radians (which is at
odds with the codebase that uses degrees 99% of the time).
And fix a bug in one implementation of TransInsScale (this function is
not used in the codebase).

These transform_t functions deal with composing rotation, translation,
and scale operations. So transform_t represents a similarity-preserving
transformation. All of the q_math transform functions get a test, except
the 3 that have to do with interpolation (I'm not sure how that is
supposed to work).
In 2 cases we were forming a vector from (a.xyz, b.w) but it turns out
the "junk" w component of a already contained the desired b.w value, so
we can just use a is-is.
Fixes the Clang part of
DaemonEngine#1312. The problem is that
LLVM wrongly considers __m128 to have floating-point semantics at all
times. When it sees an all-ones mask in some component it wrongly sees
it as a NaN and replaces it with an undefined value when in
-ffinite-math mode.

In the cases where the new first_XYZ_second_W is used, that is actually
what Clang itself outputs after optimizing the original intrinsics code
(with a non-bugged flag configuration). So hopefully it is faster
anyway.
@illwieckz
Copy link
Member

I confirm it fixes the bugs with Clang 19 from:

But it doesn't fix the bugs with GCC 14.

@illwieckz
Copy link
Member

I confirm that I get no bug when combining:

  • an engine built with either Clang 19.1.5 or GCC 14.2.0,
  • a nexe game built with either PNaCl 3.6.0 or Saigo 19.0.0.

Copy link
Contributor

@DolceTriade DolceTriade left a comment

Choose a reason for hiding this comment

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

if it fixes bug, then lgtm

@slipher slipher merged commit 79598bf into DaemonEngine:master Dec 5, 2024
9 checks passed
@slipher slipher deleted the clang-models branch December 5, 2024 00:15
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.

3 participants