Skip to content

Commit

Permalink
implment cmove_int32
Browse files Browse the repository at this point in the history
  • Loading branch information
chenju2k6 committed Nov 17, 2017
1 parent e1f09e8 commit f5bcbba
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Enclave/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@ void print_arr(const int32_t* arr, int32_t len)
for (int32_t i = 0; i < len; ++i) EPrintf("%d ", arr[i]);
EPrintf("\n");
}


void cmove_int32(bool cond, int32_t* src, int32_t* dest) {
__asm__ (
"mov %%rdi, %%rax\n\t"
"mov (%%rsi),%%rbx\n\t"
"cmove %%rbx,%%rcx\n\t"
"mov %%rcx,(%%rdx)\n\t"
:::
);
}

0 comments on commit f5bcbba

Please sign in to comment.