11.6Smatt/*	$NetBSD: fpsetsticky.S,v 1.6 2013/01/11 13:55:26 matt Exp $	*/
21.1Sbjh21
31.6Smatt/*-
41.6Smatt * Copyright (c) 2013 The NetBSD Foundation, Inc.
51.1Sbjh21 * All rights reserved.
61.1Sbjh21 *
71.6Smatt * This code is derived from software contributed to The NetBSD Foundation
81.6Smatt * by Matt Thomas of 3am Software Foundry.
91.6Smatt *
101.1Sbjh21 * Redistribution and use in source and binary forms, with or without
111.1Sbjh21 * modification, are permitted provided that the following conditions
121.1Sbjh21 * are met:
131.1Sbjh21 * 1. Redistributions of source code must retain the above copyright
141.1Sbjh21 *    notice, this list of conditions and the following disclaimer.
151.1Sbjh21 * 2. Redistributions in binary form must reproduce the above copyright
161.1Sbjh21 *    notice, this list of conditions and the following disclaimer in the
171.1Sbjh21 *    documentation and/or other materials provided with the distribution.
181.1Sbjh21 *
191.6Smatt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
201.6Smatt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
211.6Smatt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
221.6Smatt * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
231.6Smatt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
241.6Smatt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
251.6Smatt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
261.6Smatt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
271.6Smatt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
281.6Smatt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
291.6Smatt * POSSIBILITY OF SUCH DAMAGE.
301.1Sbjh21 */
311.1Sbjh21
321.6Smatt#ifndef __VFP_FP__
331.6Smatt#error FPA is not supported anymore
341.6Smatt#endif
351.6Smatt
361.6Smatt#include <arm/asm.h>
371.6Smatt#include <arm/vfpreg.h>
381.1Sbjh21
391.1Sbjh21/*
401.1Sbjh21 * Set the current FP cumulative flags
411.1Sbjh21 */
421.1Sbjh21
431.2Sthorpej#ifdef WEAK_ALIAS
441.2SthorpejWEAK_ALIAS(fpsetsticky, _fpsetsticky)
451.6Smatt#define	fpsetsticky	_fpsetsticky
461.6Smatt#endif
471.6Smatt
481.1Sbjh21ENTRY(fpsetsticky)
491.6Smatt	and	r1, r0, #VFP_FPSCR_CSUM
501.6Smatt	vmrs	r0, fpscr
511.6Smatt	bic	r2, r0, #VFP_FPSCR_CSUM
521.6Smatt	orr	r1, r1, r2
531.6Smatt	vmsr	fpscr, r1
541.6Smatt	and	r0, r0, #VFP_FPSCR_CSUM
551.4Srearnsha	RET
561.6SmattEND(fpsetsticky)
57