xref: /netbsd-src/lib/libc/arch/arm/hardfloat/fpgetmask.S (revision 29673540c653e03b245e5d6c87fab8a62cf252ef)
1*29673540Smatt/*	$NetBSD: fpgetmask.S,v 1.7 2013/08/02 02:07:00 matt Exp $	*/
25aefcfdcSbjh21
360e85183Smatt/*-
460e85183Smatt * Copyright (c) 2013 The NetBSD Foundation, Inc.
55aefcfdcSbjh21 * All rights reserved.
65aefcfdcSbjh21 *
760e85183Smatt * This code is derived from software contributed to The NetBSD Foundation
860e85183Smatt * by Matt Thomas of 3am Software Foundry.
960e85183Smatt *
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 *
1960e85183Smatt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2060e85183Smatt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2160e85183Smatt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2260e85183Smatt * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2360e85183Smatt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2460e85183Smatt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2560e85183Smatt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2660e85183Smatt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2760e85183Smatt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2860e85183Smatt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2960e85183Smatt * POSSIBILITY OF SUCH DAMAGE.
305aefcfdcSbjh21 */
315aefcfdcSbjh21
3260e85183Smatt#ifndef __VFP_FP__
3360e85183Smatt#error FPA is not supported anymore
3460e85183Smatt#endif
3560e85183Smatt#include <arm/asm.h>
3660e85183Smatt#include <arm/vfpreg.h>
375aefcfdcSbjh21
385aefcfdcSbjh21/*
395aefcfdcSbjh21 * Return the current FP exception enable mask
405aefcfdcSbjh21 */
415aefcfdcSbjh21
425d3e8294Sthorpej#ifdef WEAK_ALIAS
435d3e8294SthorpejWEAK_ALIAS(fpgetmask, _fpgetmask)
4460e85183Smatt#define fpgetmask	_fpgetmask
4560e85183Smatt#endif
4660e85183Smatt
475aefcfdcSbjh21ENTRY(fpgetmask)
48*29673540Smatt	vmrs    r0, fpscr
4960e85183Smatt	mov	r0, r0, lsr #8
50*29673540Smatt	and	r0, r0, #VFP_FPSCR_CSUM
51d6621260Srearnsha	RET
5260e85183SmattEND(fpgetmask)
53