Skip to content

Instantly share code, notes, and snippets.

View tanakamura's full-sized avatar

Takashi Nakamura tanakamura

View GitHub Profile
/*
* i7-4700MQ Win8.1 : 9533.579865clk
*/
#include <windows.h>
#include <setjmp.h>
#define NUM (4096*8)
volatile int counter = 0;
jmp_buf jbuf;
/*
* i7-4700MQ Win8.1 : 9533.579865clk
* i7-4700MQ Linux 3.11.4-201.fc19.x86_6 : 1815.603760
*/
#include <signal.h>
#include <setjmp.h>
#include <x86intrin.h>
#include <stdio.h>
#include <clang-c/Index.h>
#include <stdio.h>
#include <stdlib.h>
struct FindState {
bool find;
int target_line;
CXCursor loop;
};
#include <stdio.h>
int func(int v) {
printf("%d\n", v);
return 0;
}
void f1(unsigned char b, unsigned char c) {
auto a = b + c;
func(a);
matmul_x86_fma_:
.LFB1165:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
addq %rdi, %rcx
vxorps %xmm0, %xmm0, %xmm0
movq %rsp, %rbp
.cfi_def_cfa_register 6
#include <immintrin.h>
#include <stdio.h>
#include <intrin.h>
/*
lookup8:
subq $12, %rsp
.seh_stackalloc 12
.seh_endprologue
movl %edx, (%rsp)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
double
sec(void)
{
struct timespec ts;
#include <pmmintrin.h>
double ddotp2(double *u,
double *v,
int n)
{
int i;
__m128d x = _mm_setzero_pd();
for (i=0; i<n-1; i+=2) {
x = _mm_add_pd(x, _mm_mul_pd(_mm_loadu_pd(&u[i]),
@tanakamura
tanakamura / gist:7295694
Last active December 27, 2015 08:19
write throughput
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#ifdef _WIN32
#include <windows.h>
double
sec()
{
LARGE_INTEGER freq, v;
@tanakamura
tanakamura / printf2.c
Last active December 27, 2015 08:28
printf
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
FILE *log_file;
int write_total;
char buffer[1024];
#ifdef _WIN32
#include <windows.h>