This file contains hidden or 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
unsigned long long test_multi_load_store(unsigned int * restrict ull_arr1, unsigned int ull_len1) { | |
unsigned long long sum = 0; | |
for (unsigned int idx = 0; idx < ull_len1; idx++) { | |
sum += ull_arr1[idx]; | |
} | |
return sum; | |
} | |
//gcc assembler output | |
//gcc -mavx2 -ftree-vectorize -march=native -fno-inline -O3 -m64 -S |
This file contains hidden or 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
unsigned long long test_reduce_right() { | |
__m128i m128_1, m128_2; | |
__m256i m256_1, m256_2, m256_3; | |
unsigned long long total; | |
__asm { | |
mov r8, 0x4444333322221111 | |
movq xmm8, r8 | |
mov r9, 0x8888777766665555 | |
movq xmm9, r9 |
This file contains hidden or 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
char *string_source = (char*)malloc(256 * sizeof(char)); | |
string_source = "1234567"; | |
char *string_dest = (char*)malloc(256 * sizeof(char)); | |
__asm { | |
mov rsi, string_source | |
mov rdi, string_dest | |
movsq //copy 8 bytes to [rdi] from [rsi] | |
} | |
printf("string_source: %s\n, string_dest: %s\n", string_source, string_dest); |
This file contains hidden or 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
var $inputText1 = $('input[type=text]')[0]; | |
setTimeout( function() { | |
//chrome and IE | |
//also move focus away from URL bar into the window so users can zoomin/out in IE | |
//right away after IntraMaps is loaded | |
window.focus(); | |
//firefox workaround, window.focus() does not work, | |
//so use focus() and blur() | |
$inputText1 && $inputText1.focus(); |
This file contains hidden or 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
int shapefileType = -1; | |
//#define SHP_POINT 1 | |
//#define SHP_ARC 3 | |
//#define SHP_POLYGON 5 | |
//#define SHP_MULTIPOINT 8 | |
//#define SHP_POINTZ 11 | |
//#define SHP_ARCZ 13 | |
//#define SHP_POLYGONZ 15 | |
//#define SHP_MULTIPOINTZ 18 |
This file contains hidden or 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
// | |
// Created by Moses DeJong on 7/2/13. | |
// This software has been placed in the public domain. | |
// This file implements the following C functions for the ARM platform. | |
// Both ARM6 and ARM7 devices are supported by this implementation. | |
// This ARM asm file will generate an error with clang 4 (xcode 4.5 and newer) because | |
// the integrated assembler does not accept AT&T syntax. This .s target will need to | |
// have the "-no-integrated-as" command line option passed via |
This file contains hidden or 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
[stillImageOutput captureStillImageAsynchronouslyFromConnection:stillImageConnection | |
completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error) { | |
if (error) { | |
[self displayErrorOnMainQueue:error withMessage:@"Take picture failed"]; | |
} | |
else { | |
//got an image | |
CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(imageDataSampleBuffer); | |
This file contains hidden or 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 -ex | |
DEVELOPER=`xcode-select --print-path` | |
PLATFORM="iPhoneOS" | |
ARCH="armv7" | |
IPHONE_SDK="7.0" | |
IPHONE_MIN_VERSION="5.0" | |
VERSION="1.3.0" | |
NASM_VERSION="2.10.09" |
This file contains hidden or 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
Table 2, General purpose registers and AAPCS64 usage | |
Register Special Role in the procedure call standard | |
SP The Stack Pointer. | |
r30 LR The Link Register. | |
r29 FP The Frame Pointer | |
r19...r28 Callee-saved registers |
This file contains hidden or 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
//extern uint32_t* test_strb1_x64(uint32_t* wordPtr, uint32_t numWords); | |
//extern uint32_t* test_malloc3(uint32_t* wordPtr, uint32_t numWords); | |
//extern void test_malloc4(); | |
//extern uint32_t* test_malloc5(uint32_t intToSet); | |
.private_extern _test_strb1_x64 | |
.globl _test_strb1_x64 | |
.align 2 | |
_test_strb1_x64: |