diff options
Diffstat (limited to 'vm/compiler/template/armv5te-vfp/TEMPLATE_CMPL_FLOAT_VFP.S')
-rw-r--r-- | vm/compiler/template/armv5te-vfp/TEMPLATE_CMPL_FLOAT_VFP.S | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/vm/compiler/template/armv5te-vfp/TEMPLATE_CMPL_FLOAT_VFP.S b/vm/compiler/template/armv5te-vfp/TEMPLATE_CMPL_FLOAT_VFP.S new file mode 100644 index 0000000..bdb42d6 --- /dev/null +++ b/vm/compiler/template/armv5te-vfp/TEMPLATE_CMPL_FLOAT_VFP.S @@ -0,0 +1,32 @@ +%verify "executed" +%verify "basic lt, gt, eq */ +%verify "left arg NaN" +%verify "right arg NaN" + /* + * Compare two floating-point values. Puts 0, 1, or -1 into the + * destination register based on the results of the comparison. + * + * int compare(x, y) { + * if (x == y) { + * return 0; + * } else if (x > y) { + * return 1; + * } else if (x < y) { + * return -1; + * } else { + * return -1; + * } + * } + * On entry: + * r0 = &op1 [vBB] + * r1 = &op2 [vCC] + */ + /* op vAA, vBB, vCC */ + flds s0, [r0] @ d0<- vBB + flds s1, [r1] @ d1<- vCC + fcmps s0, s1 @ compare (vBB, vCC) + mvn r0, #0 @ r0<- -1 (default) + fmstat @ export status flags + movgt r0, #1 @ (greater than) r0<- 1 + moveq r0, #0 @ (equal) r0<- 0 + bx lr |