xref: /netbsd-src/sys/external/bsd/compiler_rt/dist/lib/builtins/negdi2.c (revision f7f78b3373aafafa211473d7733a8806c0e402c0)
1156cd587Sjoerg /* ===-- negdi2.c - Implement __negdi2 -------------------------------------===
2156cd587Sjoerg  *
3156cd587Sjoerg  *                     The LLVM Compiler Infrastructure
4156cd587Sjoerg  *
5156cd587Sjoerg  * This file is dual licensed under the MIT and the University of Illinois Open
6156cd587Sjoerg  * Source Licenses. See LICENSE.TXT for details.
7156cd587Sjoerg  *
8156cd587Sjoerg  * ===----------------------------------------------------------------------===
9156cd587Sjoerg  *
10156cd587Sjoerg  * This file implements __negdi2 for the compiler_rt library.
11156cd587Sjoerg  *
12156cd587Sjoerg  * ===----------------------------------------------------------------------===
13156cd587Sjoerg  */
14156cd587Sjoerg 
15156cd587Sjoerg #include "int_lib.h"
16156cd587Sjoerg 
17156cd587Sjoerg /* Returns: -a */
18156cd587Sjoerg 
19*f7f78b33Sjoerg COMPILER_RT_ABI di_int
__negdi2(di_int a)20156cd587Sjoerg __negdi2(di_int a)
21156cd587Sjoerg {
22156cd587Sjoerg     /* Note: this routine is here for API compatibility; any sane compiler
23156cd587Sjoerg      * should expand it inline.
24156cd587Sjoerg      */
25156cd587Sjoerg     return -a;
26156cd587Sjoerg }
27