本文整理汇总了C++中FN函数的典型用法代码示例。如果您正苦于以下问题:C++ FN函数的具体用法?C++ FN怎么用?C++ FN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FN函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Dis_FPU2op
void Dis_FPU2op(MIPSOpcode op, char *out)
{
int fs = _FS;
int fd = _FD;
const char *name = MIPSGetName(op);
sprintf(out, "%s\t%s, %s",name,FN(fd),FN(fs));
}
示例2: Dis_FPUComp
void Dis_FPUComp(MIPSOpcode op, char *out)
{
int fs = _FS;
int ft = _FT;
const char *name = MIPSGetName(op);
sprintf(out, "%s\t%s, %s",name,FN(fs),FN(ft));
}
示例3: setup_engine
static bool setup_engine(
struct i2c_engine *i2c_engine)
{
struct i2c_hw_engine_dce110 *hw_engine = FROM_I2C_ENGINE(i2c_engine);
/* Program pin select */
REG_UPDATE_6(
DC_I2C_CONTROL,
DC_I2C_GO, 0,
DC_I2C_SOFT_RESET, 0,
DC_I2C_SEND_RESET, 0,
DC_I2C_SW_STATUS_RESET, 1,
DC_I2C_TRANSACTION_COUNT, 0,
DC_I2C_DDC_SELECT, hw_engine->engine_id);
/* Program time limit */
REG_UPDATE_N(
SETUP, 2,
FN(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_TIME_LIMIT), I2C_SETUP_TIME_LIMIT,
FN(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_ENABLE), 1);
/* Program HW priority
* set to High - interrupt software I2C at any time
* Enable restart of SW I2C that was interrupted by HW
* disable queuing of software while I2C is in use by HW */
REG_UPDATE_2(
DC_I2C_ARBITRATION,
DC_I2C_NO_QUEUED_SW_GO, 0,
DC_I2C_SW_PRIORITY, DC_I2C_ARBITRATION__DC_I2C_SW_PRIORITY_NORMAL);
return true;
}
示例4: setup_engine
static bool setup_engine(
struct dce_i2c_hw *dce_i2c_hw)
{
uint32_t i2c_setup_limit = I2C_SETUP_TIME_LIMIT_DCE;
if (dce_i2c_hw->setup_limit != 0)
i2c_setup_limit = dce_i2c_hw->setup_limit;
/* Program pin select */
REG_UPDATE_6(DC_I2C_CONTROL,
DC_I2C_GO, 0,
DC_I2C_SOFT_RESET, 0,
DC_I2C_SEND_RESET, 0,
DC_I2C_SW_STATUS_RESET, 1,
DC_I2C_TRANSACTION_COUNT, 0,
DC_I2C_DDC_SELECT, dce_i2c_hw->engine_id);
/* Program time limit */
if (dce_i2c_hw->send_reset_length == 0) {
/*pre-dcn*/
REG_UPDATE_N(SETUP, 2,
FN(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_TIME_LIMIT), i2c_setup_limit,
FN(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_ENABLE), 1);
}
/* Program HW priority
* set to High - interrupt software I2C at any time
* Enable restart of SW I2C that was interrupted by HW
* disable queuing of software while I2C is in use by HW
*/
REG_UPDATE_2(DC_I2C_ARBITRATION,
DC_I2C_NO_QUEUED_SW_GO, 0,
DC_I2C_SW_PRIORITY, DC_I2C_ARBITRATION__DC_I2C_SW_PRIORITY_NORMAL);
return true;
}
示例5: execute_transaction
static void execute_transaction(
struct dce_i2c_hw *dce_i2c_hw)
{
REG_UPDATE_N(SETUP, 5,
FN(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_DATA_DRIVE_EN), 0,
FN(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_CLK_DRIVE_EN), 0,
FN(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_DATA_DRIVE_SEL), 0,
FN(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_INTRA_TRANSACTION_DELAY), 0,
FN(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_INTRA_BYTE_DELAY), 0);
REG_UPDATE_5(DC_I2C_CONTROL,
DC_I2C_SOFT_RESET, 0,
DC_I2C_SW_STATUS_RESET, 0,
DC_I2C_SEND_RESET, 0,
DC_I2C_GO, 0,
DC_I2C_TRANSACTION_COUNT, dce_i2c_hw->transaction_count - 1);
/* start I2C transfer */
REG_UPDATE(DC_I2C_CONTROL, DC_I2C_GO, 1);
/* all transactions were executed and HW buffer became empty
* (even though it actually happens when status becomes DONE)
*/
dce_i2c_hw->transaction_count = 0;
dce_i2c_hw->buffer_used_bytes = 0;
}
示例6: Dis_FPU3op
void Dis_FPU3op(u32 op, char *out)
{
int ft = _FT;
int fs = _FS;
int fd = _FD;;
const char *name = MIPSGetName(op);
sprintf(out, "%s\t%s, %s, %s",name,FN(fd),FN(fs),FN(ft));
}
示例7: FN
int FN(bscc_main)()
{
int *arr;
int i, j, t, sz;
sz=1<<22;
arr=malloc(sz*sizeof(int));
for(i=0; i<sz; i++)arr[i]=rand()*251+rand();
t=clock();
FN(hsortm)(arr, sz);
printf("HSort %d\n", clock()-t);
FN(sortchk)(arr, sz);
for(i=0; i<sz; i++)arr[i]=rand()*251+rand();
t=clock();
FN(Sort0)(arr, 0, sz);
printf("Sort0 %d\n", clock()-t);
FN(sortchk)(arr, sz);
for(i=0; i<sz; i++)arr[i]=rand()*251+rand();
t=clock();
FN(Sort1)(arr, 0, sz);
printf("Sort1 %d\n", clock()-t);
FN(sortchk)(arr, sz);
for(i=0; i<sz; i++)arr[i]=rand()*251+rand();
t=clock();
FN(Sort2)(arr, 0, sz);
printf("Sort2 %d\n", clock()-t);
FN(sortchk)(arr, sz);
for(i=0; i<sz; i++)arr[i]=rand()*251+rand();
t=clock();
qsort(arr, sz, 4, FN(qs_cmp_i));
printf("QSort %d\n", clock()-t);
FN(sortchk)(arr, sz);
return(0);
}
示例8: FN
//---------------------------------------------------------------------------
bool File::Exists(const Ztring &File_Name)
{
#ifdef ZENLIB_USEWX
wxFileName FN(File_Name.c_str());
return FN.FileExists();
#else //ZENLIB_USEWX
#ifdef ZENLIB_STANDARD
if (File_Name.find(__T('*'))!=std::string::npos || File_Name.find(__T('?'))!=std::string::npos)
return false;
struct stat buffer;
int status;
#ifdef UNICODE
status=stat(File_Name.To_Local().c_str(), &buffer);
#else
status=stat(File_Name.c_str(), &buffer);
#endif //UNICODE
return status==0 && S_ISREG(buffer.st_mode);
#elif defined WINDOWS
if (File_Name.find(__T('*'))!=std::string::npos || (File_Name.find(__T("\\\\?\\"))!=0 && File_Name.find(__T('?'))!=std::string::npos) || (File_Name.find(__T("\\\\?\\"))==0 && File_Name.find(__T('?'), 4)!=std::string::npos))
return false;
#ifdef UNICODE
DWORD FileAttributes=GetFileAttributesW(File_Name.c_str());
#else
DWORD FileAttributes=GetFileAttributes(File_Name.c_str());
#endif //UNICODE
return ((FileAttributes!=INVALID_FILE_ATTRIBUTES) && !(FileAttributes&FILE_ATTRIBUTE_DIRECTORY));
#endif
#endif //ZENLIB_USEWX
}
示例9: FN
//---------------------------------------------------------------------------
Ztring& FileName::Extension_Set(const Ztring &Extension)
{
#ifdef ZENLIB_USEWX
wxFileName FN(c_str());
FN.SetExt(Extension.c_str());
assign (FN.GetFullPath().c_str());
#else //ZENLIB_USEWX
#ifdef WINDOWS
//Path limit
size_t Pos_Path=rfind(_T('\\'));
if (Pos_Path==Ztring::npos)
Pos_Path=0; //Not found
//Extension limit
size_t Pos_Ext=rfind(_T('.'));
if (Pos_Ext==Ztring::npos || Pos_Ext<Pos_Path)
{
append(1, _T('.')); //Not found
Pos_Ext=size()-1;
}
replace(Pos_Ext+1, size()-Pos_Ext-1, Extension, 0, Ztring::npos);
#else
//Not supported
#endif
#endif //ZENLIB_USEWX
return *this;
}
示例10: FN
//---------------------------------------------------------------------------
bool Dir::Exists(const Ztring &File_Name)
{
#ifdef ZENLIB_USEWX
wxFileName FN(File_Name.c_str());
return FN.DirExists();
#else //ZENLIB_USEWX
#ifdef WINDOWS
#ifdef UNICODE
DWORD FileAttributes;
#ifndef ZENLIB_NO_WIN9X_SUPPORT
if (IsWin9X_Fast())
FileAttributes=GetFileAttributesA(File_Name.To_Local().c_str());
else
#endif //ZENLIB_NO_WIN9X_SUPPORT
FileAttributes=GetFileAttributesW(File_Name.c_str());
#else
DWORD FileAttributes=GetFileAttributes(File_Name.c_str());
#endif //UNICODE
return ((FileAttributes!=INVALID_FILE_ATTRIBUTES) && (FileAttributes&FILE_ATTRIBUTE_DIRECTORY));
#else //WINDOWS
struct stat buffer;
int status;
#ifdef UNICODE
status=stat(File_Name.To_Local().c_str(), &buffer);
#else
status=stat(File_Name.c_str(), &buffer);
#endif //UNICODE
return status==0 && S_ISDIR(buffer.st_mode);
#endif
#endif //ZENLIB_USEWX
}
示例11: FN
//---------------------------------------------------------------------------
bool File::Exists(const Ztring &File_Name)
{
#ifdef ZENLIB_USEWX
wxFileName FN(File_Name.c_str());
return FN.FileExists();
#else //ZENLIB_USEWX
#ifdef ZENLIB_STANDARD
struct stat buffer;
int status;
#ifdef UNICODE
status=stat(File_Name.To_Local().c_str(), &buffer);
#else
status=stat(File_Name.c_str(), &buffer);
#endif //UNICODE
return status==0 && S_ISREG(buffer.st_mode);
#elif defined WINDOWS
#ifdef UNICODE
DWORD FileAttributes;
if (IsWin9X())
FileAttributes=GetFileAttributesA(File_Name.To_Local().c_str());
else
FileAttributes=GetFileAttributesW(File_Name.c_str());
#else
DWORD FileAttributes=GetFileAttributes(File_Name.c_str());
#endif //UNICODE
return ((FileAttributes!=INVALID_FILE_ATTRIBUTES) && !(FileAttributes&FILE_ATTRIBUTE_DIRECTORY));
#endif
#endif //ZENLIB_USEWX
}
示例12: _
void wxWidgetsGUIConfigPanel::OnButton1Click(wxCommandEvent& event)
{
wxString FileName = ::wxFileSelector(
_("Select resource file"),
_T(""),_T(""),_T(""),
_("XRC files (*.xrc)|*.xrc|"
"Zipped files (*.zip)|*.zip|"
"All files (*)|*"),
wxFD_OPEN | wxFD_FILE_MUST_EXIST | compatibility::wxHideReadonly);
if ( !FileName.empty() )
{
wxFileName FN(FileName);
FN.MakeRelativeTo(m_GUI->GetProjectPath());
wxString Ext = FN.GetExt();
FileName = FN.GetFullPath();
if ( Ext == _T("zip") || Ext == _T("ZIP") )
{
FileName.Append(_T("#zip:*.xrc"));
}
wxString CurrentContent = AutoLoad->GetValue();
if ( CurrentContent.Length() && ( CurrentContent[CurrentContent.Length()-1] != _T('\n') ) )
{
AutoLoad->AppendText(_T("\n"));
}
AutoLoad->AppendText(FileName);
AutoLoad->AppendText(_T("\n"));
}
}
示例13: release_engine
static void release_engine(
struct dce_i2c_hw *dce_i2c_hw)
{
bool safe_to_reset;
/* Restore original HW engine speed */
set_speed(dce_i2c_hw, dce_i2c_hw->original_speed);
/* Release I2C */
REG_UPDATE(DC_I2C_ARBITRATION, DC_I2C_SW_DONE_USING_I2C_REG, 1);
/* Reset HW engine */
{
uint32_t i2c_sw_status = 0;
REG_GET(DC_I2C_SW_STATUS, DC_I2C_SW_STATUS, &i2c_sw_status);
/* if used by SW, safe to reset */
safe_to_reset = (i2c_sw_status == 1);
}
if (safe_to_reset)
REG_UPDATE_2(DC_I2C_CONTROL,
DC_I2C_SOFT_RESET, 1,
DC_I2C_SW_STATUS_RESET, 1);
else
REG_UPDATE(DC_I2C_CONTROL, DC_I2C_SW_STATUS_RESET, 1);
/* HW I2c engine - clock gating feature */
if (!dce_i2c_hw->engine_keep_power_up_count)
REG_UPDATE_N(SETUP, 1, FN(SETUP, DC_I2C_DDC1_ENABLE), 0);
}
示例14: Dis_mxc1
void Dis_mxc1(MIPSOpcode op, char *out)
{
int fs = _FS;
int rt = _RT;
const char *name = MIPSGetName(op);
sprintf(out, "%s\t%s, %s",name,RN(rt),FN(fs));
}
示例15: main
int main(){
prepare_shuffling_dictionary();
prepare_shuffling_dictionary_avx();
const testcase tests[] = {
{
"equal lists",
{0,2,4,7, 11,13,23,32, 33,42,44,48, 53,55,60,64}, // list1
{0,2,4,7, 11,13,23,32, 33,42,44,48, 53,55,60,64}, // list2
{0,2,4,7, 11,13,23,32, 33,42,44,48, 53,55,60,64}, // intersection result
{0,2,4,7, 11,13,23,32, 33,42,44,48, 53,55,60,64}, // union result
{} // difference result
},{
"completely different lists",
{0,2,4,7, 11,13,23,32, 33,42,44,48, 53,55,60,64},
{1,3,5,6, 10,12,27,31, 36,47,50,51, 52,66,77,88},
{},
{0,1,2,3,4,5,6,7, 10,11,12,13,23,27,31,32, 33,36,42,44,47,48,50,51, 52,53,55,60,64,66,77,88},
{0,2,4,7, 11,13,23,32, 33,42,44,48, 53,55,60,64}
},{
"no match in first",
{0,2,4,7, 11,13,23,32, 33,42,44,48, 53,55,60,64, 66,67,68,69, 77,78,79,80, 81,82,83,84, 87,88,89,99},
{1,3,5,6, 10,12,27,31, 36,47,50,51, 52,66,77,88},
{66,77,88},
{0,1,2,3,4,5,6,7, 10,11,12,13,23,27,31,32, 33,36,42,44,47,48,50,51, 52,53,55,60,64, 66,67,68,69, 77,78,79,80, 81,82,83,84, 87,88,89,99},
{0,2,4,7, 11,13,23,32, 33,42,44,48, 53,55,60,64, 67,68,69, 78,79,80, 81,82,83,84, 87,89,99}
}
};
constexpr int tests_size = sizeof(tests) / sizeof(testcase);
#define FN(x) {#x, x}
run(
tests, tests_size,
{
FN(intersect_vector_sse),
FN(intersect_vector_sse_asm),
FN(intersect_vector_avx),
#ifdef __AVX2__
FN(intersect_vector_avx2),
FN(intersect_vector_avx2_asm)
#endif
},
{
FN(union_vector_sse)
},
{
FN(difference_vector_sse),
#ifdef __AVX2__
FN(difference_vector_avx2),
#endif
}
);
free(shuffle_mask_avx);
return 0;
}