Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. const std = @import("std");
  2.  
  3. extern fn hello_world() void;
  4.  
  5. const _mm128i align(16) = struct {
  6.     data: [16]u8,
  7. };
  8.  
  9. extern fn load_si128(*const _mm128i) c_int;
  10. extern fn loadu_si128(*const _mm128i) c_int;
  11.  
  12.  
  13.  
  14. pub fn main() void {
  15.     hello_world();
  16.  
  17.     var data = _mm128i{ .data = [1]u8{97} ** 16 };
  18.  
  19.     var load = loadu_si128(data);
  20.  
  21.     var real = @ptrCast(*_mm128i, &load);
  22.  
  23.     var dereffed = real.*;
  24.  
  25.     std.debug.warn("{}\n", dereffed);
  26.  
  27.     for (dereffed.data) |c| {
  28.         std.debug.warn("{}\n", c);
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement