Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fintelia committed Nov 30, 2021
1 parent c67f291 commit fb98408
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 1 deletion.
32 changes: 32 additions & 0 deletions tests/out/glsl/bits.main.Compute.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,38 @@ void main() {
u3_ = bitfieldExtract(_e112, int(5u), int(10u));
uvec4 _e116 = u4_;
u4_ = bitfieldExtract(_e116, int(5u), int(10u));
int _e120 = i;
i = findLSB(_e120);
ivec2 _e122 = i2_;
i2_ = findLSB(_e122);
ivec3 _e124 = i3_;
i3_ = findLSB(_e124);
ivec4 _e126 = i4_;
i4_ = findLSB(_e126);
uint _e128 = u;
i = findLSB(_e128);
uvec2 _e130 = u2_;
i2_ = findLSB(_e130);
uvec3 _e132 = u3_;
i3_ = findLSB(_e132);
uvec4 _e134 = u4_;
i4_ = findLSB(_e134);
int _e136 = i;
i = findMSB(_e136);
ivec2 _e138 = i2_;
i2_ = findMSB(_e138);
ivec3 _e140 = i3_;
i3_ = findMSB(_e140);
ivec4 _e142 = i4_;
i4_ = findMSB(_e142);
uint _e144 = u;
i = findMSB(_e144);
uvec2 _e146 = u2_;
i2_ = findMSB(_e146);
uvec3 _e148 = u3_;
i3_ = findMSB(_e148);
uvec4 _e150 = u4_;
i4_ = findMSB(_e150);
return;
}

32 changes: 32 additions & 0 deletions tests/out/msl/bits.msl
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,37 @@ kernel void main_(
u3_ = metal::extract_bits(_e112, 5u, 10u);
metal::uint4 _e116 = u4_;
u4_ = metal::extract_bits(_e116, 5u, 10u);
int _e120 = i;
i = (((metal::ctz(_e120) + 1) % 33) - 1);
metal::int2 _e122 = i2_;
i2_ = (((metal::ctz(_e122) + 1) % 33) - 1);
metal::int3 _e124 = i3_;
i3_ = (((metal::ctz(_e124) + 1) % 33) - 1);
metal::int4 _e126 = i4_;
i4_ = (((metal::ctz(_e126) + 1) % 33) - 1);
metal::uint _e128 = u;
i = (((metal::ctz(_e128) + 1) % 33) - 1);
metal::uint2 _e130 = u2_;
i2_ = (((metal::ctz(_e130) + 1) % 33) - 1);
metal::uint3 _e132 = u3_;
i3_ = (((metal::ctz(_e132) + 1) % 33) - 1);
metal::uint4 _e134 = u4_;
i4_ = (((metal::ctz(_e134) + 1) % 33) - 1);
int _e136 = i;
i = (((metal::clz(_e136) + 1) % 33) - 1);
metal::int2 _e138 = i2_;
i2_ = (((metal::clz(_e138) + 1) % 33) - 1);
metal::int3 _e140 = i3_;
i3_ = (((metal::clz(_e140) + 1) % 33) - 1);
metal::int4 _e142 = i4_;
i4_ = (((metal::clz(_e142) + 1) % 33) - 1);
metal::uint _e144 = u;
i = (((metal::clz(_e144) + 1) % 33) - 1);
metal::uint2 _e146 = u2_;
i2_ = (((metal::clz(_e146) + 1) % 33) - 1);
metal::uint3 _e148 = u3_;
i3_ = (((metal::clz(_e148) + 1) % 33) - 1);
metal::uint4 _e150 = u4_;
i4_ = (((metal::clz(_e150) + 1) % 33) - 1);
return;
}
50 changes: 49 additions & 1 deletion tests/out/spv/bits.spvasm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.1
; Generator: rspirv
; Bound: 111
; Bound: 143
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
Expand Down Expand Up @@ -151,5 +151,53 @@ OpStore %31 %108
%109 = OpLoad %16 %33
%110 = OpBitFieldUExtract %16 %109 %9 %10
OpStore %33 %110
%111 = OpLoad %4 %19
%112 = OpExtInst %4 %1 FindILsb %111
OpStore %19 %112
%113 = OpLoad %11 %21
%114 = OpExtInst %11 %1 FindILsb %113
OpStore %21 %114
%115 = OpLoad %12 %23
%116 = OpExtInst %12 %1 FindILsb %115
OpStore %23 %116
%117 = OpLoad %13 %25
%118 = OpExtInst %13 %1 FindILsb %117
OpStore %25 %118
%119 = OpLoad %6 %27
%120 = OpExtInst %4 %1 FindILsb %119
OpStore %19 %120
%121 = OpLoad %14 %29
%122 = OpExtInst %11 %1 FindILsb %121
OpStore %21 %122
%123 = OpLoad %15 %31
%124 = OpExtInst %12 %1 FindILsb %123
OpStore %23 %124
%125 = OpLoad %16 %33
%126 = OpExtInst %13 %1 FindILsb %125
OpStore %25 %126
%127 = OpLoad %4 %19
%128 = OpExtInst %4 %1 FindSMsb %127
OpStore %19 %128
%129 = OpLoad %11 %21
%130 = OpExtInst %11 %1 FindSMsb %129
OpStore %21 %130
%131 = OpLoad %12 %23
%132 = OpExtInst %12 %1 FindSMsb %131
OpStore %23 %132
%133 = OpLoad %13 %25
%134 = OpExtInst %13 %1 FindSMsb %133
OpStore %25 %134
%135 = OpLoad %6 %27
%136 = OpExtInst %4 %1 FindUMsb %135
OpStore %19 %136
%137 = OpLoad %14 %29
%138 = OpExtInst %11 %1 FindUMsb %137
OpStore %21 %138
%139 = OpLoad %15 %31
%140 = OpExtInst %12 %1 FindUMsb %139
OpStore %23 %140
%141 = OpLoad %16 %33
%142 = OpExtInst %13 %1 FindUMsb %141
OpStore %25 %142
OpReturn
OpFunctionEnd
32 changes: 32 additions & 0 deletions tests/out/wgsl/bits.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,37 @@ fn main() {
u3_ = extractBits(_e112, 5u, 10u);
let _e116 = u4_;
u4_ = extractBits(_e116, 5u, 10u);
let _e120 = i;
i = findLsb(_e120);
let _e122 = i2_;
i2_ = findLsb(_e122);
let _e124 = i3_;
i3_ = findLsb(_e124);
let _e126 = i4_;
i4_ = findLsb(_e126);
let _e128 = u;
i = findLsb(_e128);
let _e130 = u2_;
i2_ = findLsb(_e130);
let _e132 = u3_;
i3_ = findLsb(_e132);
let _e134 = u4_;
i4_ = findLsb(_e134);
let _e136 = i;
i = findMsb(_e136);
let _e138 = i2_;
i2_ = findMsb(_e138);
let _e140 = i3_;
i3_ = findMsb(_e140);
let _e142 = i4_;
i4_ = findMsb(_e142);
let _e144 = u;
i = findMsb(_e144);
let _e146 = u2_;
i2_ = findMsb(_e146);
let _e148 = u3_;
i3_ = findMsb(_e148);
let _e150 = u4_;
i4_ = findMsb(_e150);
return;
}

0 comments on commit fb98408

Please sign in to comment.