This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* test the behaviour of rdffr with extending loads */ | |
#include <assert.h> | |
#include <arm_sve.h> | |
#include <sys/mman.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
int main() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MMX caeasar chiffre implementation | |
# for i686 with MMX | |
# signature: | |
# caesar(out, in, len, key) | |
# key is between 0 and 25 | |
.section .text | |
.globl caesar | |
.type caesar,@function | |
.align 16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// getnumericvalue(ptr) | |
.section .text | |
.type getnumericvalue, @function | |
.globl getnumericvalue | |
getnumericvalue: | |
xor %eax, %eax // digit counter | |
// process string until we reach cache-line alignment | |
test $64-1, %dil // is ptr aligned to 64 byte? | |
jz 0f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// b:a = a+b+c, v31.16b used for scratch space | |
.macro csa, a, b, c | |
eor v31.16b, \a\().16b, \b\().16b | |
eor \a\().16b, v31.16b, \c\().16b | |
bit \b\().16b, \c\().16b, v31.16b | |
.endm | |
// d:a = a+b+c | |
.macro csac a, b, c, d | |
eor \d\().16b, \a\().16b, \b\().16b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "textflag.h" | |
// func PospopcntMem(counts *[8]int32, buf []byte) | |
TEXT ·PospopcntMem(SB),NOSPLIT,$0-32 | |
MOVQ counts+0(FP), DI | |
MOVQ buf_base+8(FP), SI // SI = &buf[0] | |
MOVQ buf_len+16(FP), CX // CX = len(buf) | |
SUBQ $32, CX // pre-subtract 32 bit from CX | |
JL scalar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _XOPEN_SOURCE 700 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
extern void pospopcnt_reg(int accum[8], const char *buf, size_t len); | |
extern void pospopcnt_mem(int accum[8], const char *buf, size_t len); | |
extern void |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
extern int | |
main(int argc, char *argv[]) | |
{ | |
ssize_t count; | |
int flags; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* parallel wc(1) demo program */ | |
/* cc -O3 -fopenmp -o wc wc.c */ | |
#include <ctype.h> | |
#include <unistd.h> | |
#include <omp.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <sys/stat.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* http://stackoverflow.com/a/1732454/417501 */ | |
%{ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <string.h> | |
#define MYEOF EOF | |
#define TOKEN_URL 257 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PATH="$PATH:/usr/local/bin" | |
export LC_CTYPE=C | |
export LC_COLLATE=C | |
# decode URL encoded $1 and print result to stdout | |
urldecode() { | |
gawk "BEGIN { print \"$(echo "$1" | sed -e 's/"/\\"/' -e 's/+/ /g' -e 's/%/\\x/g')\" }" </dev/null | |
} |
NewerOlder