Skip to content

Instantly share code, notes, and snippets.

@jacobtolar
Created January 30, 2012 01:08
Show Gist options
  • Select an option

  • Save jacobtolar/1701754 to your computer and use it in GitHub Desktop.

Select an option

Save jacobtolar/1701754 to your computer and use it in GitHub Desktop.
shr.s32 %r6, %r5, 1; ; r6 = bc /2
mov.u32 %r7, %ctaid.y;
mul.lo.u32 %r8, %r7, 2; ; r8 = blkIdx.y * 2
add.u32 %r9, %r6, %r8; ; mbh = r6 + r8
and.b32 %r10, %r5, 1; ; r10 = bc & 1
mov.u32 %r11, %ctaid.x;
mul.lo.u32 %r12, %r11, 2; ; r12 = blkIdx.x * 2
add.u32 %r13, %r10, %r12; ; mbw = r10 + r12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment