Skip to content

Commit

Permalink
Fixed ARM-NEON GCC conformance issue with half-precision optimization…
Browse files Browse the repository at this point in the history
…s on ARM64
  • Loading branch information
walbourn committed Jan 11, 2021
1 parent 5d15267 commit 5a5d2bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions Inc/DirectXPackedVector.inl
Original file line number Diff line number Diff line change
Expand Up @@ -644,13 +644,13 @@ inline HALF* XMConvertFloatToHalfStream

uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat));

vst1_lane_u16(reinterpret_cast<float*>(pHalf), vHalf, 0);
vst1_lane_u16(reinterpret_cast<uint16_t*>(pHalf), vHalf, 0);
pHalf += OutputStride;
vst1_lane_u16(reinterpret_cast<float*>(pHalf), vHalf, 1);
vst1_lane_u16(reinterpret_cast<uint16_t*>(pHalf), vHalf, 1);
pHalf += OutputStride;
vst1_lane_u16(reinterpret_cast<float*>(pHalf), vHalf, 2);
vst1_lane_u16(reinterpret_cast<uint16_t*>(pHalf), vHalf, 2);
pHalf += OutputStride;
vst1_lane_u16(reinterpret_cast<float*>(pHalf), vHalf, 3);
vst1_lane_u16(reinterpret_cast<uint16_t*>(pHalf), vHalf, 3);
pHalf += OutputStride;
i += 4;
}
Expand Down Expand Up @@ -701,13 +701,13 @@ inline HALF* XMConvertFloatToHalfStream

uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat));

vst1_lane_u16(reinterpret_cast<float*>(pHalf), vHalf, 0);
vst1_lane_u16(reinterpret_cast<uint16_t*>(pHalf), vHalf, 0);
pHalf += OutputStride;
vst1_lane_u16(reinterpret_cast<float*>(pHalf), vHalf, 1);
vst1_lane_u16(reinterpret_cast<uint16_t*>(pHalf), vHalf, 1);
pHalf += OutputStride;
vst1_lane_u16(reinterpret_cast<float*>(pHalf), vHalf, 2);
vst1_lane_u16(reinterpret_cast<uint16_t*>(pHalf), vHalf, 2);
pHalf += OutputStride;
vst1_lane_u16(reinterpret_cast<float*>(pHalf), vHalf, 3);
vst1_lane_u16(reinterpret_cast<uint16_t*>(pHalf), vHalf, 3);
pHalf += OutputStride;
i += 4;
}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2011-2020 Microsoft Corp
Copyright (c) 2011-2021 Microsoft Corp

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
Expand Down

1 comment on commit 5a5d2bd

@walbourn
Copy link
Member Author

Choose a reason for hiding this comment

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

No impact for Visual C++ or clang/LLVM, but does fix a break for GCC on arm64

Please sign in to comment.