1*7c3d14c8STreehugger Robot//===-- aeabi_fcmp.S - EABI fcmp* implementation ---------------------------===// 2*7c3d14c8STreehugger Robot// 3*7c3d14c8STreehugger Robot// The LLVM Compiler Infrastructure 4*7c3d14c8STreehugger Robot// 5*7c3d14c8STreehugger Robot// This file is dual licensed under the MIT and the University of Illinois Open 6*7c3d14c8STreehugger Robot// Source Licenses. See LICENSE.TXT for details. 7*7c3d14c8STreehugger Robot// 8*7c3d14c8STreehugger Robot//===----------------------------------------------------------------------===// 9*7c3d14c8STreehugger Robot 10*7c3d14c8STreehugger Robot#include "../assembly.h" 11*7c3d14c8STreehugger Robot 12*7c3d14c8STreehugger Robot// int __aeabi_fcmp{eq,lt,le,ge,gt}(float a, float b) { 13*7c3d14c8STreehugger Robot// int result = __{eq,lt,le,ge,gt}sf2(a, b); 14*7c3d14c8STreehugger Robot// if (result {==,<,<=,>=,>} 0) { 15*7c3d14c8STreehugger Robot// return 1; 16*7c3d14c8STreehugger Robot// } else { 17*7c3d14c8STreehugger Robot// return 0; 18*7c3d14c8STreehugger Robot// } 19*7c3d14c8STreehugger Robot// } 20*7c3d14c8STreehugger Robot 21*7c3d14c8STreehugger Robot#define DEFINE_AEABI_FCMP(cond) \ 22*7c3d14c8STreehugger Robot .syntax unified SEPARATOR \ 23*7c3d14c8STreehugger Robot .p2align 2 SEPARATOR \ 24*7c3d14c8STreehugger RobotDEFINE_COMPILERRT_FUNCTION(__aeabi_fcmp ## cond) \ 25*7c3d14c8STreehugger Robot push { r4, lr } SEPARATOR \ 26*7c3d14c8STreehugger Robot bl SYMBOL_NAME(__ ## cond ## sf2) SEPARATOR \ 27*7c3d14c8STreehugger Robot cmp r0, #0 SEPARATOR \ 28*7c3d14c8STreehugger Robot b ## cond 1f SEPARATOR \ 29*7c3d14c8STreehugger Robot mov r0, #0 SEPARATOR \ 30*7c3d14c8STreehugger Robot pop { r4, pc } SEPARATOR \ 31*7c3d14c8STreehugger Robot1: SEPARATOR \ 32*7c3d14c8STreehugger Robot mov r0, #1 SEPARATOR \ 33*7c3d14c8STreehugger Robot pop { r4, pc } SEPARATOR \ 34*7c3d14c8STreehugger RobotEND_COMPILERRT_FUNCTION(__aeabi_fcmp ## cond) 35*7c3d14c8STreehugger Robot 36*7c3d14c8STreehugger RobotDEFINE_AEABI_FCMP(eq) 37*7c3d14c8STreehugger RobotDEFINE_AEABI_FCMP(lt) 38*7c3d14c8STreehugger RobotDEFINE_AEABI_FCMP(le) 39*7c3d14c8STreehugger RobotDEFINE_AEABI_FCMP(ge) 40*7c3d14c8STreehugger RobotDEFINE_AEABI_FCMP(gt) 41*7c3d14c8STreehugger Robot 42*7c3d14c8STreehugger RobotNO_EXEC_STACK_DIRECTIVE 43*7c3d14c8STreehugger Robot 44