1%verify "executed" 2%verify "basic lt, gt, eq */ 3%verify "left arg NaN" 4%verify "right arg NaN" 5 /* 6 * Compare two floating-point values. Puts 0, 1, or -1 into the 7 * destination register based on the results of the comparison. 8 * 9 * int compare(x, y) { 10 * if (x == y) { 11 * return 0; 12 * } else if (x < y) { 13 * return -1; 14 * } else if (x > y) { 15 * return 1; 16 * } else { 17 * return 1; 18 * } 19 * } 20 * On entry: 21 * r0 = &op1 [vBB] 22 * r1 = &op2 [vCC] 23 */ 24 /* op vAA, vBB, vCC */ 25 flds s0, [r0] @ d0<- vBB 26 flds s1, [r1] @ d1<- vCC 27 fcmps s0, s1 @ compare (vBB, vCC) 28 mov r0, #1 @ r0<- 1 (default) 29 fmstat @ export status flags 30 mvnmi r0, #0 @ (less than) r0<- -1 31 moveq r0, #0 @ (equal) r0<- 0 32 bx lr 33