Skip to content

Instantly share code, notes, and snippets.

@jacobly0
Created January 20, 2017 19:56
Show Gist options
  • Select an option

  • Save jacobly0/c0efa4dde1b13ee3d8a6bf3836ceb731 to your computer and use it in GitHub Desktop.

Select an option

Save jacobly0/c0efa4dde1b13ee3d8a6bf3836ceb731 to your computer and use it in GitHub Desktop.
define i1 @bittest(i4096* %i, i32 %n) {
%1 = lshr i32 %n, 3
%2 = bitcast i4096* %i to i8*
%3 = getelementptr i8, i8* %2, i32 %1
%4 = load i8, i8* %3
%5 = trunc i32 %n to i8
%6 = and i8 %5, 7
%7 = lshr i8 %4, %6
%8 = and i8 %7, 1
%9 = icmp ne i8 %7, 0
ret i1 %9
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment