xref: /netbsd-src/lib/libc/arch/arm/hardfloat/fpgetsticky.S (revision 60e851836f800c27172ddd158f61000ca8d17d34)
1*60e85183Smatt/*	$NetBSD: fpgetsticky.S,v 1.6 2013/01/11 13:55:26 matt Exp $	*/
25aefcfdcSbjh21
3*60e85183Smatt/*-
4*60e85183Smatt * Copyright (c) 2013 The NetBSD Foundation, Inc.
55aefcfdcSbjh21 * All rights reserved.
65aefcfdcSbjh21 *
7*60e85183Smatt * This code is derived from software contributed to The NetBSD Foundation
8*60e85183Smatt * by Matt Thomas of 3am Software Foundry.
9*60e85183Smatt *
105aefcfdcSbjh21 * Redistribution and use in source and binary forms, with or without
115aefcfdcSbjh21 * modification, are permitted provided that the following conditions
125aefcfdcSbjh21 * are met:
135aefcfdcSbjh21 * 1. Redistributions of source code must retain the above copyright
145aefcfdcSbjh21 *    notice, this list of conditions and the following disclaimer.
155aefcfdcSbjh21 * 2. Redistributions in binary form must reproduce the above copyright
165aefcfdcSbjh21 *    notice, this list of conditions and the following disclaimer in the
175aefcfdcSbjh21 *    documentation and/or other materials provided with the distribution.
185aefcfdcSbjh21 *
19*60e85183Smatt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20*60e85183Smatt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21*60e85183Smatt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22*60e85183Smatt * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23*60e85183Smatt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*60e85183Smatt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*60e85183Smatt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*60e85183Smatt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*60e85183Smatt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*60e85183Smatt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*60e85183Smatt * POSSIBILITY OF SUCH DAMAGE.
305aefcfdcSbjh21 */
31*60e85183Smatt#ifndef __VFP_FP__
32*60e85183Smatt#error FPA is not supported anymore
33*60e85183Smatt#endif
345aefcfdcSbjh21
35*60e85183Smatt#include <arm/asm.h>
36*60e85183Smatt#include <arm/vfpreg.h>
375aefcfdcSbjh21
385aefcfdcSbjh21/*
395aefcfdcSbjh21 * Return the current FP cumulative flags
405aefcfdcSbjh21 */
415aefcfdcSbjh21
425d3e8294Sthorpej#ifdef WEAK_ALIAS
435d3e8294SthorpejWEAK_ALIAS(fpgetsticky, _fpgetsticky)
44*60e85183Smatt#define	fpgetsticky	_fpgetsticky
45*60e85183Smatt#endif
46*60e85183Smatt
475aefcfdcSbjh21ENTRY(fpgetsticky)
48*60e85183Smatt	vmrs	r0, fpscr
49*60e85183Smatt	and	r0, r0, #VFP_FPSCR_CSUM
50d6621260Srearnsha	RET
51*60e85183SmattEND(fpgetsticky)
52