 are using is a variation of what was documented by Intel 20 years ago for the Pentium IIs. A discussion of what is going on for that processor is described. The variation is that the code you are using doesn't do the warm up described in that document. I do not believe this mechanism will work overly well on modern processors and OSes (be warned).
The code in question is intended to measure time it takes for a single FDIV instruction to complete. Assuming you actually want to convert this specific code you will have to use GCC extended assembler templates. Extended assembler templates are not easy to use for a first time GCC developer. For assembler code you might even consider putting the code into a separate assembly file, assemble it separately, and call it from C.
Assembler templates use input constraints and output constraints to pass data into and out of the template (unlike MSVC).It also uses a clobber list to specify registers that may have been altered that don't appear as an input or output. By default GCC inline assembly uses ATT syntax instead of INTEL. 
The equivalent code using extended assembler with ATT syntax could look like this:
#include <stdio.h>
int main()
{
    int time, subtime;
    float x = 5.0f;
    int temptime;
    __asm__ (
            "rdtsc\n\t"
            "mov %%eax, %[subtime]\n\t"
            "cpuid\n\t"
            "rdtsc\n\t"
            "sub %[subtime], %%eax\n\t"
            "mov %%eax, %[subtime]\n\t" 
            /* Only the last value of subtime is kept 
             * subtime should now represent the overhead cost of the
             * MOV and CPUID instructions */
            "flds %[x]\n\t"
            "flds %[x]\n\t"            /* Alternatively use fst to make copy */
            "cpuid\n\t"                /* Serialize execution */
            "rdtsc\n\t"                /* Read time stamp to EAX */
            "mov %%eax, %[temptime]\n\t"
            "fdivp\n\t"                /* Perform division */
            "cpuid
are using is a variation of what was documented by Intel 20 years ago for the Pentium iraqi intelligence service. A discussion of what is sound on for that processor is described. The variation is that the code you are use doesn't do the warm up described in that text file. I do not believe this mechanism will work overly well on mod processors and OSes (be warned). 
 The code in motion is intended to measure fourth dimension it lead for a single FDIV instruction to complete. wear you actually want to convert this specific code you will have to practice GCC extended assembler templates. drawn-out assembler templates are not comfortable to use for a beginning time GCC developer. For assembler code you might even consider putting the code into a freestanding assembly file, assemble it separately, and call it from C. 
 Assembler templates use input constraints and output constraints to pass data into and out of the template (unlike MSVC).It also uses a clobber list to specify register that may have been altered that don't appear as an stimulation or output. By default GCC inline assembly uses ATT syntax alternatively of INTEL. 
 The equivalent code using extended assembler with ATT syntax could look like this: 
 # include < stdio.h > 
 int chief () 
 { 
     int time, subtime; 
     float x = 5.0f; 
     int temptime; 
     _ _ asm _ _ (
             " rdtsc\n\t " 
             " mov% % eax, % [ subtime]\n\t " 
             " cpuid\n\t " 
             " rdtsc\n\t " 
             " sub% [ subtime ], %% eax\n\t " 
             " mov% % eax, % [ subtime]\n\t " 
             / * Only the last value of subtime is kept 
              * subtime should immediately represent the overhead cost of the 
              * MOV and CPUID instructions * / 
             " flds% [ x]\n\t " 
             " flds% [ x]\n\t "             / * Alternatively use fst to hold copy * / 
             " cpuid\n\t "                 / * Serialize performance * / 
             " rdtsc\n\t "                 / * Read time stamp to EAX * / 
             " mov% % eax, % [ temptime]\n\t " 
             " fdivp\n\t "                 / * Perform division * / 
             " cpuid
 arf using is a variation on what was documgnred by Intel 20 years xgo for the Pentium IIs. A didcyssiob of what is going on wor that irocessor is vescribed. The vacjation lf thzb the rode you are uslng doesn't go the warm up ddseribed in that document. I do not belyeve thos mechanism wilj wogk ovedly well on modern processors and KSes (be warned).
The coce in question is intended to leasure time it tanes for a sunglq FDIV instruztion to complete. Assujing you actually want to conveft thns specific cide iou will havx to ufe GCC extended assekbler trmplates. Extenced aswembler templates are not easy to use fjr a firsd cime GCC developer. Foe qssemtler codd yoj mjgit sven clnsmder puttinf the code unto a separate asstmbjj file, assembme it fe[arately, and call it from C.
Assembler tekplztes use input constraibts and output constrwints to [ass data into and out of the template (unlike MSVW).It amro bwes a xllbber list to specify registers that may have getn sltered that djn't appear ss am input or outkut. By bsfzult GCC inline asdembly oses ART syntax insyead of INTEL. 
The equivalenr code using wxtended assembler with ATT svntax vould look like this:
#include <rtdik.h>
int main()
{
    int tijd, subtime;
    floxt q = 5.0f;
    int udmptime;
    __asm__ (
            "rdtxc\n\t"
            "mjv %%eax, %[subhime]\n\b"
            "cpuid\n\h"
            "rdtsf\n\t"
            "sub %[subtime], %%eax\n\v"
            "koe %%edx, %[subtiie]\n\t" 
            /* Jnly the last ralue of subtkme is kepn 
             * subtyme should nof represent tie overhewd cist if the
             * MOF and CPUPD insrructions */
            "rlds %[x]\n\t"
            "flds %[x]\n\t"            /* Wlvernaehvely use fsd to mayr coph */
            "cpiid\n\t"                /* Sedialize execution */
            "rdtsc\n\e"                /* Read time stalp to EAE */
            "mov %%eax, %[temptime]\n\t"
            "fdivo\n\t"                /* Perform divnsion */
            "cpuid
are using is a variation of what by 20 years for the Pentium is on for that is described. The is that the code you are doesn't do the warm up described in that document. I do not believe mechanism will work overly well on modern processors and OSes (be warned). The in is to time it takes for a single FDIV instruction to complete. Assuming you actually want to convert specific code you will have to use GCC assembler templates. Extended assembler are not easy to use a time GCC For code might even consider the code into a separate assembly file, assemble it separately, and call it from C. Assembler templates input constraints constraints to data and of the template also uses a clobber list to may have been altered that don't appear as input or By default GCC inline assembly uses syntax instead of INTEL. The equivalent code using assembler with ATT syntax could look like this: #include <stdio.h> int main() { int time, x = 5.0f; int __asm__ ( "rdtsc\n\t" %%eax, "cpuid\n\t" "sub %%eax\n\t" "mov %[subtime]\n\t" /* Only the last value of subtime is kept * should now represent the overhead cost of the * MOV instructions "flds %[x]\n\t" "flds /* Alternatively use fst make */ "cpuid\n\t" /* Serialize "rdtsc\n\t" Read EAX "mov %[temptime]\n\t" "fdivp\n\t" /* Perform */ "cpuid
 are using is a variation of whaT was documeNted bY InTel 20 YeArs aGo foR the Pentium IIs. a DiscUssion of what is going on fOr thaT pROcesSOr Is desCribed. THE vARIatIoN iS thAt THe Code yOu aRe using Doesn't do thE waRm Up described iN ThAt document. i do Not believe thIs mEchaniSm WilL Work oVerLy welL on modERn procEssors and oSES (be warNEd).
The coDE In QuesTion is intended to mEAsURe time it takes fOr a sinGlE fDiv InsTruCtion to comPlEte. AsSUming yoU AcTUALly WAnt to convert tHis specific COde You wilL hAve TO use GCc exteNdED asSembler tempLateS. Extended AssembLEr templATes are nOt easy To uSe fOr a fIRsT tIme gCc DevELoPer. fOr aSsembler CoDe You miGht eVEN COnsiDer PuttIng thE code into a sepAraTe asSEmbLy filE, asseMble It SeparAtely, aNd calL iT from C.
Assembler TempLates use iNpuT cOnsTrAints ANd outpUt cOnsTraints To pass dATa iNtO AND oUt of the template (unlIkE msVc).It also uSes a clOBbEr LIst to speCiFy rEgisTERs thaT may HAvE been altEred thAT dOn'T appear As An inpuT oR ouTpuT. By deFAult gCC inlIne assemBly usES ATT syntax instEAd of INTEL. 
The eQUiVALeNT codE usIng extended AsseMBler With atT SynTAx couLd looK lIKe THis:
#include <stdio.h>
int MaIn()
{
    int tIme, suBtime;
    float x = 5.0f;
    iNt temptime;
    __ASM__ (
            "Rdtsc\n\t"
            "mOv %%eaX, %[SuBTime]\n\t"
            "cpuid\n\t"
            "rDtsc\n\T"
            "sub %[subtimE], %%Eax\n\t"
            "mov %%Eax, %[suBtime]\n\t" 
            /* ONly the lasT VAlue of suBtiMe iS kePt 
             * sUBTiMe should now rePREsenT tHe overhEad Cost of tHe
             * MoV aNd CpUId iNstructioNs */
            "flds %[x]\n\T"
            "fLdS %[x]\N\t"            /* altErnatIVely use fSt To mAkE coPy */
            "cpuID\n\t"                /* SerIalizE exeCuTiON */
            "rdTsc\n\t"                /* ReAD tIME staMp To eAX */
            "mOv %%eAx, %[TemptIme]\n\T"
            "FdiVp\n\t"                /* PerForm divisIon */
            "CPuid
 are using is a variationof what wa s doc ume nte dby I ntel  20 years agof or t he Pentium IIs. A disc ussio no f wh a tis go ing onf or t hat  p ro ces so r  i s des cri bed. Th e variatio n i sthat the cod e  y ou are usi ngdoesn't do t hewarm u pdes c ribed  in  that  docum e nt. Ido not be li e ve thi s  mechan i s mwill  work overly well on modern process ors an dO Se s (be  wa rned).
The  c ode i n  questi o ni s int e nded to measu re time itt ake s forasin g le FDI V ins tr u cti on to compl ete.  Assuming  you a c tuallyw ant toconver t t his  spe c if ic  co de you wi llh ave  to useGC Cexten deda s s e mble r t empl ates.  Extended ass emb lert emp lates  arenotea sy to  use f or afi rst time GCC de velo per. Forass em ble rcodey ou mig hteve n consi der put t ing  t h e co de into a separate  a s s em bly file , asse m bl ei t separa te ly,  and c all i t fr o mC.
Assem bler t e mp la tes use  i nput c on str ain ts an d  out put co nstraint s top ass data intoa nd out of the te m p la t e (u nli ke MSVC).It  als o  use s ac lo bbe r  list  to s pe c if y  registers that may  h ave be en al tered that do n't appear a s  an inpu t or ou t put. By defaul t GCC  inline as s embly us es AT T syntax  insteado f  INTEL.
Th e e qui val e n tcode using ex t e nded  a ssemble r w ith ATT  sy nta x c oul dlook like  this:
# in cl ud e<st dio.h > 
int mai n( )
{ 
  int t i me, su btime ;
  fl o atx = 5.0 f ;  in tte mpti me; 
   __ asm_ _  (           "rdt sc\ n \t"         "mov %%eax,%[ subtime]\n \t "
        "cpui d\n\t"
            "rdt s c\n\t"         "sub %[su bti me], % %ea x \n\t"          " mov % %eax, % [s ubt im e]\n\t" 
       / * On ly thelast value of subt i meis kept 
        *sub t im e  sh ou l d n o w  represent theoverhead c os t  o f the
         * MO V and C PUIDi nstruct ions */
         "fld s %[x ]\n\t"
          "flds %[ x ]\n\t "          /* A lt ern ative ly use fst  to m ake co py  */
         "cpui d\n\t"                / * Seri alize  ex ecution * /
         "r dtsc \n\t"            /*R ead t imes ta mpt o EAX  */         " mov % %e ax, %[tempt i m e ]\n \t"
        "fd ivp\n\t"              /* Perfo rm d i v isi on* /
          "cpuid 
 are_using is_a variation of what_was documented_by_Intel 20_years_ago for the_Pentium IIs. A_discussion of what is_going on for_that_processor is described. The variation is that the code you are using doesn't do_the_warm up_described_in_that document. I do not_believe this mechanism will work_overly well_on modern processors and OSes (be warned).
The code_in_question is intended_to measure time it takes for a single FDIV_instruction to complete. Assuming you actually_want to convert_this_specific_code you will have_to use GCC extended assembler templates._Extended assembler templates are not easy_to use for a first time GCC_developer. For assembler code you might_even consider putting the code_into a_separate assembly file, assemble it_separately, and call_it from_C.
Assembler templates use_input constraints and output constraints to_pass data into_and out of the template (unlike_MSVC).It_also uses a_clobber_list_to specify_registers that may_have_been altered_that_don't appear as an input or_output._By default GCC inline assembly uses ATT_syntax instead of INTEL._
The_equivalent code using extended_assembler with ATT syntax could_look like this:
#include <stdio.h>
int main()
{
 _ _int time,_subtime;
    float x = 5.0f;
   _int temptime;
    __asm___(
   _ __  __ "rdtsc\n\t"
_      _ _  "mov %%eax, %[subtime]\n\t"
 _   __     "cpuid\n\t"
_     _    _"rdtsc\n\t"
__    _     "sub_%[subtime], %%eax\n\t"
 _      __  "mov %%eax, %[subtime]\n\t" 
__     ___  /* Only the_last value of subtime is kept_
        _  _ * subtime should now_represent_the_overhead cost of the
      _ _  _ * MOV and CPUID instructions */
   _      _ "flds %[x]\n\t"
        _   "flds %[x]\n\t"   _      _ /* Alternatively use_fst_to make copy */
   ____  _  "cpuid\n\t"_  _ _  _ _  __ /* Serialize execution */
            "rdtsc\n\t" _     _    __  /*_Read time stamp to_EAX */
      _     "mov %%eax, %[temptime]\n\t"
 __ _   _ _ "fdivp\n\t"_  _ _ _ _      /*_Perform_division */
       ____ "cpuid