xref: /original-bsd/lib/libc/quad/xordi3.c (revision 502e1f47)
1 /*-
2  * Copyright (c) 1992 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #if defined(LIBC_SCCS) && !defined(lint)
9 static char sccsid[] = "@(#)xordi3.c	5.2 (Berkeley) 05/12/92";
10 #endif /* LIBC_SCCS and not lint */
11 
12 /* Copyright (C) 1989, 1992 Free Software Foundation, Inc.
13 
14 This file is part of GNU CC.
15 
16 GNU CC is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 2, or (at your option)
19 any later version.
20 
21 GNU CC is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 GNU General Public License for more details.
25 
26 You should have received a copy of the GNU General Public License
27 along with GNU CC; see the file COPYING.  If not, write to
28 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
29 
30 /* As a special exception, if you link this library with files
31    compiled with GCC to produce an executable, this does not cause
32    the resulting executable to be covered by the GNU General Public License.
33    This exception does not however invalidate any other reasons why
34    the executable file might be covered by the GNU General Public License.  */
35 
36 #include "longlong.h"
37 
38 long long
39 __xordi3 (u, v)
40      long long u, v;
41 {
42   long_long w;
43   long_long uu, vv;
44 
45   uu.ll = u;
46   vv.ll = v;
47 
48   w.s.high = uu.s.high ^ vv.s.high;
49   w.s.low = uu.s.low ^ vv.s.low;
50 
51   return w.ll;
52 }
53