11.6Smatt/* $NetBSD: llabs.S,v 1.6 2013/07/16 21:48:32 matt Exp $ */ 21.1Skleink 31.1Skleink/*- 41.1Skleink * Copyright (c) 1990 The Regents of the University of California. 51.1Skleink * All rights reserved. 61.1Skleink * 71.1Skleink * This code is derived from software contributed to Berkeley by 81.1Skleink * the Systems Programming Group of the University of Utah Computer 91.1Skleink * Science Department. 101.1Skleink * 111.1Skleink * Redistribution and use in source and binary forms, with or without 121.1Skleink * modification, are permitted provided that the following conditions 131.1Skleink * are met: 141.1Skleink * 1. Redistributions of source code must retain the above copyright 151.1Skleink * notice, this list of conditions and the following disclaimer. 161.1Skleink * 2. Redistributions in binary form must reproduce the above copyright 171.1Skleink * notice, this list of conditions and the following disclaimer in the 181.1Skleink * documentation and/or other materials provided with the distribution. 191.3Sagc * 3. Neither the name of the University nor the names of its contributors 201.1Skleink * may be used to endorse or promote products derived from this software 211.1Skleink * without specific prior written permission. 221.1Skleink * 231.1Skleink * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 241.1Skleink * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 251.1Skleink * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 261.1Skleink * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 271.1Skleink * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 281.1Skleink * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 291.1Skleink * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 301.1Skleink * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 311.1Skleink * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 321.1Skleink * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 331.1Skleink * SUCH DAMAGE. 341.1Skleink */ 351.1Skleink 361.1Skleink#include <machine/asm.h> 371.1Skleink 381.1Skleink#if defined(LIBC_SCCS) && !defined(lint) 391.1Skleink#if 0 401.1Skleink RCSID("from: @(#)abs.s 5.1 (Berkeley) 5/12/90") 411.1Skleink#else 421.6Smatt RCSID("$NetBSD: llabs.S,v 1.6 2013/07/16 21:48:32 matt Exp $") 431.1Skleink#endif 441.1Skleink#endif /* LIBC_SCCS and not lint */ 451.1Skleink 461.2SkleinkWEAK_ALIAS(llabs, _llabs) 471.4SmattWEAK_ALIAS(imaxabs, _llabs) 481.6Smatt 491.1Skleink/* llabs - long long int absolute value */ 501.1Skleink 511.2SkleinkENTRY(_llabs) 521.5Smatt movl 8(%sp),%d1 531.5Smatt movl 4(%sp),%d0 541.1Skleink jge L1 551.1Skleink negl %d1 561.1Skleink negxl %d0 571.1SkleinkL1: 581.1Skleink rts 591.6SmattEND(_llabs) 60