1%default {"preinstr":"", "chkzero":"0"} 2 /* 3 * Generic 32-bit binary float operation. a0 = a1 op a2. 4 * 5 * For: add-fp, sub-fp, mul-fp, div-fp 6 * 7 * On entry: 8 * a0 = target dalvik register address 9 * a1 = op1 address 10 * a2 = op2 address 11 * 12 * IMPORTANT: you may specify "chkzero" or "preinstr" but not both. 13 * 14 */ 15 move rOBJ, a0 # save a0 16#ifdef SOFT_FLOAT 17 LOAD(a0, a1) # a0<- vBB 18 LOAD(a1, a2) # a1<- vCC 19 .if $chkzero 20 beqz a1, common_errDivideByZero # is second operand zero? 21 .endif 22 $preinstr # optional op 23 $instr # v0 = result 24 STORE(v0, rOBJ) # vAA <- v0 25#else 26 LOAD_F(fa0, a1) # fa0<- vBB 27 LOAD_F(fa1, a2) # fa1<- vCC 28 .if $chkzero 29 # is second operand zero? 30 li.s ft0, 0 31 c.eq.s fcc0, ft0, fa1 # condition bit and comparision with 0 32 bc1t fcc0, common_errDivideByZero 33 .endif 34 $preinstr # optional op 35 $instr_f # fv0 = result 36 STORE_F(fv0, rOBJ) # vAA <- fv0 37#endif 38 RETURN 39