prefetch_linux_sparc.inline.hpp revision 1472:c18cbe5936b8
114125Speter/*
214125Speter * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
314125Speter * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
414125Speter *
514125Speter * This code is free software; you can redistribute it and/or modify it
614125Speter * under the terms of the GNU General Public License version 2 only, as
714125Speter * published by the Free Software Foundation.
814125Speter *
914125Speter * This code is distributed in the hope that it will be useful, but WITHOUT
1014125Speter * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1114125Speter * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1214125Speter * version 2 for more details (a copy is included in the LICENSE file that
1314125Speter * accompanied this code).
14263142Seadler *
1514125Speter * You should have received a copy of the GNU General Public License version
1614125Speter * 2 along with this work; if not, write to the Free Software Foundation,
1714125Speter * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1814125Speter *
1914125Speter * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2014125Speter * or visit www.oracle.com if you need additional information or have any
2114125Speter * questions.
2214125Speter *
2314125Speter */
2414125Speter
2514125Speter#if defined(COMPILER2) || defined(_LP64)
2614125Speter
2714125Speterinline void Prefetch::read(void *loc, intx interval) {
2814125Speter  __asm__ volatile("prefetch [%0+%1], 0" : : "r" (loc), "r" (interval) : "memory" );
2914125Speter}
3050479Speter
3114125Speterinline void Prefetch::write(void *loc, intx interval) {
32355368Srpokala  __asm__ volatile("prefetch [%0+%1], 2" : : "r" (loc), "r" (interval) : "memory" );
3314125Speter}
3414125Speter
3514125Speter#else
3679755Sdd
3714125Speterinline void Prefetch::read (void *loc, intx interval) {}
3814125Speterinline void Prefetch::write(void *loc, intx interval) {}
3968965Sru
4014125Speter#endif
41355368Srpokala