MCQs > IT & Programming > C++ > Study and select proper answer? ifdef defined(__x86_64__) static inline unsigned long long rdtsc(void) { unsigned hi, lo; asm volatile ('rdtsc' : '=a'(lo), '=d'(hi)); return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 ); } elif defined(powerpc) static inline unsigned long long rdtsc(void) { unsigned long long int result=0; unsigned long int upper, lower,tmp; asm volatile( '0: \n' '\tmftbu %0 \n' '\tmftb %1 \n' '\tmftbu %2 \n' '\tcmpw %2,%0 \n' '\tbne 0b \n' : '=r'(upper),'=r'(lower),'=r'(tmp) ); result = upper; result = result<<32; result = result|lower; return(result); } endif

C++ MCQs

Study below codes and select proper answer? ifdef defined(__x86_64__) static inline unsigned long long rdtsc(void) { unsigned hi, lo; asm volatile ("rdtsc" : "=a"(lo), "=d"(hi)); return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 ); } elif defined(powerpc) static inline unsigned long long rdtsc(void) { unsigned long long int result=0; unsigned long int upper, lower,tmp; asm volatile( "0: \n" "\tmftbu %0 \n" "\tmftb %1 \n" "\tmftbu %2 \n" "\tcmpw %2,%0 \n" "\tbne 0b \n" : "=r"(upper),"=r"(lower),"=r"(tmp) ); result = upper; result = result<<32; result = result|lower; return(result); } endif

Answer

Correct Answer: Read rdtsc register value for x86 and RAM data from address 0 for PowerPC architecture

Explanation:

Note: This Question is unanswered, help us to find answer for this one

C++ Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

C++ Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it