1*0d34bfa2Suebayasi/* $NetBSD: llabs.S,v 1.6 2014/05/23 02:34:19 uebayasi Exp $ */ 2e4d7c2e3Skleink 3e4d7c2e3Skleink/*- 4e4d7c2e3Skleink * Copyright (c) 1990 The Regents of the University of California. 5e4d7c2e3Skleink * All rights reserved. 6e4d7c2e3Skleink * 7e4d7c2e3Skleink * This code is derived from software contributed to Berkeley by 8e4d7c2e3Skleink * William Jolitz. 9e4d7c2e3Skleink * 10e4d7c2e3Skleink * Redistribution and use in source and binary forms, with or without 11e4d7c2e3Skleink * modification, are permitted provided that the following conditions 12e4d7c2e3Skleink * are met: 13e4d7c2e3Skleink * 1. Redistributions of source code must retain the above copyright 14e4d7c2e3Skleink * notice, this list of conditions and the following disclaimer. 15e4d7c2e3Skleink * 2. Redistributions in binary form must reproduce the above copyright 16e4d7c2e3Skleink * notice, this list of conditions and the following disclaimer in the 17e4d7c2e3Skleink * documentation and/or other materials provided with the distribution. 18eb7c1594Sagc * 3. Neither the name of the University nor the names of its contributors 19e4d7c2e3Skleink * may be used to endorse or promote products derived from this software 20e4d7c2e3Skleink * without specific prior written permission. 21e4d7c2e3Skleink * 22e4d7c2e3Skleink * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23e4d7c2e3Skleink * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24e4d7c2e3Skleink * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25e4d7c2e3Skleink * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26e4d7c2e3Skleink * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27e4d7c2e3Skleink * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28e4d7c2e3Skleink * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29e4d7c2e3Skleink * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30e4d7c2e3Skleink * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31e4d7c2e3Skleink * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32e4d7c2e3Skleink * SUCH DAMAGE. 33e4d7c2e3Skleink * 34e4d7c2e3Skleink * from: @(#)abs.s 5.2 (Berkeley) 12/17/90 35e4d7c2e3Skleink */ 36e4d7c2e3Skleink 37e4d7c2e3Skleink#include <machine/asm.h> 38e4d7c2e3Skleink#if defined(LIBC_SCCS) 39*0d34bfa2Suebayasi RCSID("$NetBSD: llabs.S,v 1.6 2014/05/23 02:34:19 uebayasi Exp $") 40e4d7c2e3Skleink#endif 41e4d7c2e3Skleink 423529d6d1Skleink#ifdef WEAK_ALIAS 432262305eSkleinkWEAK_ALIAS(llabs, _llabs) 44cac8e449SmattWEAK_ALIAS(imaxabs, _llabs) 453529d6d1Skleink#endif 463529d6d1Skleink 473529d6d1Skleink#ifdef WEAK_ALIAS 483529d6d1SkleinkENTRY(_llabs) 492262305eSkleink#else 50cac8e449SmattSTRONG_ALIAS(imaxabs, llabs) 512262305eSkleinkENTRY(llabs) 523529d6d1Skleink#endif 53e4d7c2e3Skleink movl 8(%esp),%edx 54e4d7c2e3Skleink movl 4(%esp),%eax 55e4d7c2e3Skleink testl %edx,%edx 56e4d7c2e3Skleink jns 1f 57e4d7c2e3Skleink negl %eax 58e4d7c2e3Skleink adcl $0,%edx 59e4d7c2e3Skleink negl %edx 60e4d7c2e3Skleink1: ret 61*0d34bfa2Suebayasi#ifdef WEAK_ALIAS 62*0d34bfa2SuebayasiEND(_llabs) 63*0d34bfa2Suebayasi#else 64*0d34bfa2SuebayasiEND(llabs) 65*0d34bfa2Suebayasi#endif 66