Home | History | Annotate | Download | only in x86
      1 %default {"is_double":"1","nanval":"1"}
      2 %verify "executed"
      3 %verify "basic lt, gt, eq"
      4 %verify "left arg NaN"
      5 %verify "right arg NaN"
      6     /* float/double_cmp[gl] vAA, vBB, vCC */
      7     movzbl    3(rPC),%eax             # eax<- CC
      8     movzbl    2(rPC),%ecx             # ecx<- BB
      9     .if $is_double
     10     fldl     (rFP,%eax,4)
     11     fldl     (rFP,%ecx,4)
     12     .else
     13     flds     (rFP,%eax,4)
     14     flds     (rFP,%ecx,4)
     15     .endif
     16     movzbl   rINST_HI,rINST_FULL
     17     xorl     %ecx,%ecx
     18     fucompp     # z if equal, p set if NaN, c set if st0 < st1
     19     fnstsw   %ax
     20     sahf
     21     movl      rINST_FULL,%eax
     22     FETCH_INST_WORD(2)
     23     jp       .L${opcode}_isNaN
     24     je       .L${opcode}_finish
     25     sbbl     %ecx,%ecx
     26     jb       .L${opcode}_finish
     27     incl     %ecx
     28 .L${opcode}_finish:
     29     SET_VREG(%ecx,%eax)
     30     ADVANCE_PC(2)
     31     GOTO_NEXT
     32 %break
     33 
     34 .L${opcode}_isNaN:
     35     movl      $$$nanval,%ecx
     36     jmp       .L${opcode}_finish
     37