Skip to content
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

Generation of 32bit value for <4 x i8> looks wrong #36

Closed
dneto0 opened this issue Aug 25, 2017 · 1 comment
Closed

Generation of 32bit value for <4 x i8> looks wrong #36

dneto0 opened this issue Aug 25, 2017 · 1 comment
Assignees
Labels
Projects

Comments

@dneto0
Copy link
Collaborator

dneto0 commented Aug 25, 2017

When accumulating the bits, this:

       IntValue = (IntValue << Idx) | Val;      

Should probably be:

       IntValue = (IntValue << 8 * Idx) | Val;      
@dneto0 dneto0 self-assigned this Aug 25, 2017
@dneto0 dneto0 added the bug label Aug 25, 2017
@dneto0
Copy link
Collaborator Author

dneto0 commented Aug 25, 2017

This example shows the problem, and more:

kernel void foo(global uchar4* A) {
 *A = (uchar4)(7,8,9,10);
}

Generates code like:

     %uint_7 = OpConstant %uint 7
     %uint_8 = OpConstant %uint 8
     %uint_9 = OpConstant %uint 9
    %uint_10 = OpConstant %uint 10
         %17 = OpConstantComposite %uint %uint_7 %uint_8 %uint_9 %uint_10
     ...
         %24 = OpFunction %void None %8
         %25 = OpLabel
         %26 = OpAccessChain %_ptr_StorageBuffer_uint %23 %uint_0_0 %uint_0_0
               OpStore %26 %17

That OpConstantComposite is just wrong.

@dneto0 dneto0 added this to Ready to start in General Aug 25, 2017
@dneto0 dneto0 moved this from Ready to start to In progress in General Aug 25, 2017
dneto0 added a commit to dneto0/clspv that referenced this issue Aug 26, 2017
Cover both when all components are int constants, or
when some are undef values.

Fixes google#36
@dneto0 dneto0 moved this from In progress to Done in General Aug 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
General
  
Done
Development

No branches or pull requests

1 participant