2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A/* Copyright (c) 1988 AT&T */
2N/A/* All Rights Reserved */
2N/A
2N/A .file "ladd.s"
2N/A
2N/A/*
2N/A * Double long add routine. Ported from pdp 11/70 version
2N/A * with considerable effort. All supplied comments were ported.
2N/A *
2N/A * Ported from m32 version to sparc. No comments about difficulty.
2N/A *
2N/A * dl_t
2N/A * ladd (lop, rop)
2N/A * dl_t lop;
2N/A * dl_t rop;
2N/A */
2N/A
2N/A#include "SYS.h"
2N/A
2N/A ENTRY(ladd)
2N/A
2N/A ld [%o7+8],%o4 ! Instruction at ret-addr should be a
2N/A cmp %o4,8 ! 'unimp 8' indicating a valid call.
2N/A be 1f ! if OK, go forward.
2N/A nop ! delay instruction.
2N/A jmp %o7+8 ! return
2N/A nop ! delay instruction.
2N/A
2N/A1:
2N/A ld [%o0+0],%o2 ! fetch lop.dl_hop
2N/A ld [%o0+4],%o3 ! fetch lop.dl_lop
2N/A ld [%o1+0],%o4 ! fetch rop.dl_hop
2N/A ld [%o1+4],%o5 ! fetch rop.dl_lop
2N/A addcc %o3,%o5,%o3 ! lop.dl_lop + rop.dl_lop (set carry)
2N/A addxcc %o2,%o4,%o2 ! lop.dl_hop + rop.dl_hop + <carry>
2N/A ld [%sp+(16*4)],%o0 ! address to store result into
2N/A st %o2,[%o0+0] ! store result, dl_hop
2N/A jmp %o7+12 ! return
2N/A st %o3,[%o0+4] ! store result, dl_lop
2N/A
2N/A SET_SIZE(ladd)