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 xorl %ecx,%ecx 17 fucompp # z if equal, p set if NaN, c set if st0 < st1 18 fnstsw %ax 19 sahf 20 FETCH_INST_OPCODE 2 %eax 21 jp .L${opcode}_isNaN 22 je .L${opcode}_finish 23 sbbl %ecx,%ecx 24 jb .L${opcode}_finish 25 incl %ecx 26 .L${opcode}_finish: 27 SET_VREG %ecx rINST 28 ADVANCE_PC 2 29 GOTO_NEXT_R %eax 30 31 .L${opcode}_isNaN: 32 movl $$$nanval,%ecx 33 jmp .L${opcode}_finish 34