forked from google/clspv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix generation of <4 x i8> constants
Cover both when all components are int constants, or when some are undef values. Fixes google#36
- Loading branch information
Showing
4 changed files
with
93 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
// Test for https://github.com/google/clspv/issues/36 | ||
// A <4 x 18> constant was generated incorrectly. | ||
|
||
kernel void dup(global uchar4 *B) { | ||
*B = (uchar4)(1,128,3,4); | ||
} | ||
|
||
// RUN: clspv %s -S -o %t.spvasm | ||
// RUN: FileCheck %s < %t.spvasm | ||
// RUN: clspv %s -o %t.spv | ||
// RUN: spirv-dis -o %t2.spvasm %t.spv | ||
// RUN: FileCheck %s < %t2.spvasm | ||
// RUN: spirv-val --target-env vulkan1.0 %t.spv | ||
|
||
|
||
// CHECK: [[uint:%[_a-zA-Z0-9]+]] = OpTypeInt 32 0 | ||
// CHECK: [[theconst:%[_a-zA-Z0-9]+]] = OpConstant [[uint]] 25166596 | ||
// CHECK-DAG: OpStore {{%[_a-zA-Z0-9]+}} [[theconst]] | ||
// CHECK-NOT: OpStore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
// Test for https://github.com/google/clspv/issues/36 | ||
// A <4 x 18> constant was generated incorrectly. | ||
|
||
kernel void dup(global uchar4 *B) { | ||
*B = (uchar4)(0,0,0,0); | ||
} | ||
|
||
// RUN: clspv %s -S -o %t.spvasm | ||
// RUN: FileCheck %s < %t.spvasm | ||
// RUN: clspv %s -o %t.spv | ||
// RUN: spirv-dis -o %t2.spvasm %t.spv | ||
// RUN: FileCheck %s < %t2.spvasm | ||
// RUN: spirv-val --target-env vulkan1.0 %t.spv | ||
|
||
|
||
// CHECK: [[uint:%[_a-zA-Z0-9]+]] = OpTypeInt 32 0 | ||
// CHECK: [[theconst:%[_a-zA-Z0-9]+]] = OpConstantNull [[uint]] | ||
// CHECK-DAG: OpStore {{%[_a-zA-Z0-9]+}} [[theconst]] | ||
// CHECK-NOT: OpStore |