Skip to content

Commit 3689d11

Browse files
committed
Fix bit rotates (#1062) by using == 0 instead of != 0 for mask_is_zero.
1 parent 59d2d2a commit 3689d11

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

CHANGELOG.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3030
## [Unreleased]
3131

3232
### Changed 🛠
33-
- [PR#1127](https://github.com/EmbarkStudios/rust-gpu/pull/1127) updated `spirv-tools` to `0.10.0`, which follows `vulkan-sdk-1.3.275`.
34-
- [PR#1101](https://github.com/EmbarkStudios/rust-gpu/pull/1101) Add `ignore` and `no_run` to documentation to make `cargo test` pass.
33+
- [PR#1127](https://github.com/EmbarkStudios/rust-gpu/pull/1127) updated `spirv-tools` to `0.10.0`, which follows `vulkan-sdk-1.3.275`
34+
- [PR#1101](https://github.com/EmbarkStudios/rust-gpu/pull/1101) added `ignore` and `no_run` to documentation to make `cargo test` pass
3535
- [PR#1112](https://github.com/EmbarkStudios/rust-gpu/pull/1112) updated wgpu and winit in example runners
3636
- [PR#1100](https://github.com/EmbarkStudios/rust-gpu/pull/1100) updated toolchain to `nightly-2023-09-30`
3737
- [PR#1091](https://github.com/EmbarkStudios/rust-gpu/pull/1091) updated toolchain to `nightly-2023-08-29`
3838
- [PR#1085](https://github.com/EmbarkStudios/rust-gpu/pull/1085) updated toolchain to `nightly-2023-07-08`
3939

40+
### Fixed 🩹
41+
- [PR#1129](https://github.com/EmbarkStudios/rust-gpu/pull/1129) fixed [#1062](https://github.com/EmbarkStudios/rust-gpu/issues/1062) by not flipping the comparison of the rotate amount with zero
42+
4043
## [0.9.0]
4144

4245
### Added ⭐

crates/rustc_codegen_spirv/src/builder/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
242242
// So we need to check for zero shift, and don't use the shift result if it is.
243243
let mask_is_zero = self
244244
.emit()
245-
.i_not_equal(bool, None, mask_shift.def(self), zero.def(self))
245+
.i_equal(bool, None, mask_shift.def(self), zero.def(self))
246246
.unwrap()
247247
.with_type(bool);
248248
self.select(mask_is_zero, value, or)

tests/ui/dis/issue-1062.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ OpLine %11 1142 4
1010
%16 = OpShiftLeftLogical %7 %6 %12
1111
%17 = OpShiftRightLogical %7 %6 %14
1212
%18 = OpBitwiseOr %7 %16 %17
13-
%19 = OpINotEqual %20 %12 %21
13+
%19 = OpIEqual %20 %12 %21
1414
%22 = OpSelect %7 %19 %6 %18
1515
%23 = OpBitwiseAnd %7 %9 %13
1616
%24 = OpISub %7 %15 %23
1717
%25 = OpShiftRightLogical %7 %6 %23
1818
%26 = OpShiftLeftLogical %7 %6 %24
1919
%27 = OpBitwiseOr %7 %25 %26
20-
%28 = OpINotEqual %20 %23 %21
20+
%28 = OpIEqual %20 %23 %21
2121
%29 = OpSelect %7 %28 %6 %27
2222
OpLine %5 12 4
2323
%30 = OpAccessChain %31 %32 %21

0 commit comments

Comments
 (0)