5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26
27 #include "gc/shared/memset_with_concurrent_readers.hpp"
28 #include "runtime/prefetch.inline.hpp"
29 #include "utilities/align.hpp"
30 #include "utilities/debug.hpp"
31 #include "utilities/globalDefinitions.hpp"
32 #include "utilities/macros.hpp"
33
34 #if INCLUDE_ALL_GCS
35
36 // An implementation of memset, for use when there may be concurrent
37 // readers of the region being stored into.
38 //
39 // We can't use the standard library memset if it is implemented using
40 // block initializing stores. Doing so can result in concurrent readers
41 // seeing spurious zeros.
42 //
43 // We can't use the obvious C/C++ for-loop, because the compiler may
44 // recognize the idiomatic loop and optimize it into a call to the
141 " stx %[xvalue], [%[aend]-56]\n\t" // aligned_end[-7] = xvalue
142 " stx %[xvalue], [%[aend]-48]\n\t"
143 " stx %[xvalue], [%[aend]-40]\n\t"
144 " stx %[xvalue], [%[aend]-32]\n\t"
145 " stx %[xvalue], [%[aend]-24]\n\t"
146 " stx %[xvalue], [%[aend]-16]\n\t"
147 " stx %[xvalue], [%[aend]-8]\n\t" // aligned_end[-1] = xvalue
148 : /* only temporaries/overwritten outputs */
149 [temp] "=&r" (temp),
150 [ato] "+&r" (aligned_to)
151 : [aend] "r" (aligned_end),
152 [xvalue] "r" (xvalue)
153 : "cc", "memory");
154 to = aligned_end; // setup for suffix
155 }
156 // Fill any partial word suffix. Also the prefix if size < BytesPerWord.
157 fill_subword(to, end, value);
158 }
159
160 #endif // INCLUDE_ALL_GCS
|
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifdef SPARC
26
27 #include "precompiled.hpp"
28
29 #include "gc/shared/memset_with_concurrent_readers.hpp"
30 #include "runtime/prefetch.inline.hpp"
31 #include "utilities/align.hpp"
32 #include "utilities/debug.hpp"
33 #include "utilities/globalDefinitions.hpp"
34 #include "utilities/macros.hpp"
35
36 #if INCLUDE_ALL_GCS
37
38 // An implementation of memset, for use when there may be concurrent
39 // readers of the region being stored into.
40 //
41 // We can't use the standard library memset if it is implemented using
42 // block initializing stores. Doing so can result in concurrent readers
43 // seeing spurious zeros.
44 //
45 // We can't use the obvious C/C++ for-loop, because the compiler may
46 // recognize the idiomatic loop and optimize it into a call to the
143 " stx %[xvalue], [%[aend]-56]\n\t" // aligned_end[-7] = xvalue
144 " stx %[xvalue], [%[aend]-48]\n\t"
145 " stx %[xvalue], [%[aend]-40]\n\t"
146 " stx %[xvalue], [%[aend]-32]\n\t"
147 " stx %[xvalue], [%[aend]-24]\n\t"
148 " stx %[xvalue], [%[aend]-16]\n\t"
149 " stx %[xvalue], [%[aend]-8]\n\t" // aligned_end[-1] = xvalue
150 : /* only temporaries/overwritten outputs */
151 [temp] "=&r" (temp),
152 [ato] "+&r" (aligned_to)
153 : [aend] "r" (aligned_end),
154 [xvalue] "r" (xvalue)
155 : "cc", "memory");
156 to = aligned_end; // setup for suffix
157 }
158 // Fill any partial word suffix. Also the prefix if size < BytesPerWord.
159 fill_subword(to, end, value);
160 }
161
162 #endif // INCLUDE_ALL_GCS
163
164 #endif // SPARC
|