Path: blob/master/src/hotspot/os_cpu/linux_arm/linux_arm_32.S
40930 views
#1# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#222324# NOTE WELL! The _Copy functions are called directly25# from server-compiler-generated code via CallLeafNoFP,26# which means that they *must* either not use floating27# point or use it in the same manner as does the server28# compiler.2930.globl _Copy_conjoint_bytes31.type _Copy_conjoint_bytes, %function32.globl _Copy_arrayof_conjoint_bytes33.type _Copy_arrayof_conjoint_bytes, %function34.globl _Copy_disjoint_words35.type _Copy_disjoint_words, %function36.globl _Copy_conjoint_words37.type _Copy_conjoint_words, %function38.globl _Copy_conjoint_jshorts_atomic39.type _Copy_conjoint_jshorts_atomic, %function40.globl _Copy_arrayof_conjoint_jshorts41.type _Copy_arrayof_conjoint_jshorts, %function42.globl _Copy_conjoint_jints_atomic43.type _Copy_conjoint_jints_atomic, %function44.globl _Copy_arrayof_conjoint_jints45.type _Copy_arrayof_conjoint_jints, %function46.globl _Copy_conjoint_jlongs_atomic47.type _Copy_conjoint_jlongs_atomic, %function48.globl _Copy_arrayof_conjoint_jlongs49.type _Copy_arrayof_conjoint_jlongs, %function5051from .req r052to .req r15354.text55.globl SpinPause56.type SpinPause, %function57SpinPause:58bx LR5960# Support for void Copy::conjoint_bytes(void* from,61# void* to,62# size_t count)63_Copy_conjoint_bytes:64swi 0x9f00016566# Support for void Copy::arrayof_conjoint_bytes(void* from,67# void* to,68# size_t count)69_Copy_arrayof_conjoint_bytes:70swi 0x9f0001717273# Support for void Copy::disjoint_words(void* from,74# void* to,75# size_t count)76_Copy_disjoint_words:77stmdb sp!, {r3 - r9, ip}7879cmp r2, #080beq disjoint_words_finish8182pld [from, #0]83cmp r2, #1284ble disjoint_words_small8586.align 387dw_f2b_loop_32:88subs r2, #3289blt dw_f2b_loop_32_finish90ldmia from!, {r3 - r9, ip}91nop92pld [from]93stmia to!, {r3 - r9, ip}94bgt dw_f2b_loop_3295dw_f2b_loop_32_finish:96addslt r2, #3297beq disjoint_words_finish98cmp r2, #1699blt disjoint_words_small100ldmia from!, {r3 - r6}101subge r2, r2, #16102stmia to!, {r3 - r6}103beq disjoint_words_finish104disjoint_words_small:105cmp r2, #8106ldr r7, [from], #4107ldrge r8, [from], #4108ldrgt r9, [from], #4109str r7, [to], #4110strge r8, [to], #4111strgt r9, [to], #4112113disjoint_words_finish:114ldmia sp!, {r3 - r9, ip}115bx lr116117118# Support for void Copy::conjoint_words(void* from,119# void* to,120# size_t count)121_Copy_conjoint_words:122stmdb sp!, {r3 - r9, ip}123124cmp r2, #0125beq conjoint_words_finish126127pld [from, #0]128cmp r2, #12129ble conjoint_words_small130131subs r3, to, from132cmphi r2, r3133bhi cw_b2f_copy134.align 3135cw_f2b_loop_32:136subs r2, #32137blt cw_f2b_loop_32_finish138ldmia from!, {r3 - r9, ip}139nop140pld [from]141stmia to!, {r3 - r9, ip}142bgt cw_f2b_loop_32143cw_f2b_loop_32_finish:144addslt r2, #32145beq conjoint_words_finish146cmp r2, #16147blt conjoint_words_small148ldmia from!, {r3 - r6}149subge r2, r2, #16150stmia to!, {r3 - r6}151beq conjoint_words_finish152conjoint_words_small:153cmp r2, #8154ldr r7, [from], #4155ldrge r8, [from], #4156ldrgt r9, [from], #4157str r7, [to], #4158strge r8, [to], #4159strgt r9, [to], #4160b conjoint_words_finish161162# Src and dest overlap, copy in a descending order163cw_b2f_copy:164add from, r2165pld [from, #-32]166add to, r2167.align 3168cw_b2f_loop_32:169subs r2, #32170blt cw_b2f_loop_32_finish171ldmdb from!, {r3-r9,ip}172nop173pld [from, #-32]174stmdb to!, {r3-r9,ip}175bgt cw_b2f_loop_32176cw_b2f_loop_32_finish:177addslt r2, #32178beq conjoint_words_finish179cmp r2, #16180blt cw_b2f_copy_small181ldmdb from!, {r3 - r6}182subge r2, r2, #16183stmdb to!, {r3 - r6}184beq conjoint_words_finish185cw_b2f_copy_small:186cmp r2, #8187ldr r7, [from, #-4]!188ldrge r8, [from, #-4]!189ldrgt r9, [from, #-4]!190str r7, [to, #-4]!191strge r8, [to, #-4]!192strgt r9, [to, #-4]!193194conjoint_words_finish:195ldmia sp!, {r3 - r9, ip}196bx lr197198# Support for void Copy::conjoint_jshorts_atomic(void* from,199# void* to,200# size_t count)201_Copy_conjoint_jshorts_atomic:202stmdb sp!, {r3 - r9, ip}203204cmp r2, #0205beq conjoint_shorts_finish206207subs r3, to, from208cmphi r2, r3209bhi cs_b2f_copy210211pld [from]212213ands r3, to, #3214bne cs_f2b_dest_u215ands r3, from, #3216bne cs_f2b_src_u217218# Aligned source address219.align 3220cs_f2b_loop_32:221subs r2, #32222blt cs_f2b_loop_32_finish223ldmia from!, {r3 - r9, ip}224nop225pld [from]226stmia to!, {r3 - r9, ip}227bgt cs_f2b_loop_32228cs_f2b_loop_32_finish:229addslt r2, #32230beq conjoint_shorts_finish231movs r6, r2, lsr #3232.align 3233cs_f2b_8_loop:234beq cs_f2b_4235ldmia from!, {r4-r5}236subs r6, #1237stmia to!, {r4-r5}238bgt cs_f2b_8_loop239240cs_f2b_4:241ands r2, #7242beq conjoint_shorts_finish243cmp r2, #4244ldrh r3, [from], #2245ldrhge r4, [from], #2246ldrhgt r5, [from], #2247strh r3, [to], #2248strhge r4, [to], #2249strhgt r5, [to], #2250b conjoint_shorts_finish251252# Destination not aligned253cs_f2b_dest_u:254ldrh r3, [from], #2255subs r2, #2256strh r3, [to], #2257beq conjoint_shorts_finish258259# Check to see if source is not aligned ether260ands r3, from, #3261beq cs_f2b_loop_32262263cs_f2b_src_u:264cmp r2, #16265blt cs_f2b_8_u266267# Load 2 first bytes to r7 and make src ptr word aligned268bic from, #3269ldr r7, [from], #4270271# Destination aligned, source not272mov r8, r2, lsr #4273.align 3274cs_f2b_16_u_loop:275mov r3, r7, lsr #16276ldmia from!, {r4 - r7}277orr r3, r3, r4, lsl #16278mov r4, r4, lsr #16279pld [from]280orr r4, r4, r5, lsl #16281mov r5, r5, lsr #16282orr r5, r5, r6, lsl #16283mov r6, r6, lsr #16284orr r6, r6, r7, lsl #16285stmia to!, {r3 - r6}286subs r8, #1287bgt cs_f2b_16_u_loop288ands r2, #0xf289beq conjoint_shorts_finish290sub from, #2291292cs_f2b_8_u:293cmp r2, #8294blt cs_f2b_4_u295ldrh r4, [from], #2296ldr r5, [from], #4297ldrh r6, [from], #2298orr r4, r4, r5, lsl #16299mov r5, r5, lsr #16300orr r5, r5, r6, lsl #16301subs r2, #8302stmia to!, {r4 - r5}303cs_f2b_4_u:304beq conjoint_shorts_finish305cmp r2, #4306ldrh r3, [from], #2307ldrhge r4, [from], #2308ldrhgt r5, [from], #2309strh r3, [to], #2310strhge r4, [to], #2311strhgt r5, [to], #2312b conjoint_shorts_finish313314# Src and dest overlap, copy in a descending order315cs_b2f_copy:316add from, r2317pld [from, #-32]318add to, r2319320ands r3, to, #3321bne cs_b2f_dest_u322ands r3, from, #3323bne cs_b2f_src_u324.align 3325cs_b2f_loop_32:326subs r2, #32327blt cs_b2f_loop_32_finish328ldmdb from!, {r3-r9,ip}329nop330pld [from, #-32]331stmdb to!, {r3-r9,ip}332bgt cs_b2f_loop_32333cs_b2f_loop_32_finish:334addslt r2, #32335beq conjoint_shorts_finish336cmp r2, #24337blt cs_b2f_16338ldmdb from!, {r3-r8}339sub r2, #24340stmdb to!, {r3-r8}341beq conjoint_shorts_finish342cs_b2f_16:343cmp r2, #16344blt cs_b2f_8345ldmdb from!, {r3-r6}346sub r2, #16347stmdb to!, {r3-r6}348beq conjoint_shorts_finish349cs_b2f_8:350cmp r2, #8351blt cs_b2f_all_copy352ldmdb from!, {r3-r4}353sub r2, #8354stmdb to!, {r3-r4}355beq conjoint_shorts_finish356357cs_b2f_all_copy:358cmp r2, #4359ldrh r3, [from, #-2]!360ldrhge r4, [from, #-2]!361ldrhgt r5, [from, #-2]!362strh r3, [to, #-2]!363strhge r4, [to, #-2]!364strhgt r5, [to, #-2]!365b conjoint_shorts_finish366367# Destination not aligned368cs_b2f_dest_u:369ldrh r3, [from, #-2]!370strh r3, [to, #-2]!371sub r2, #2372# Check source alignment as well373ands r3, from, #3374beq cs_b2f_loop_32375376# Source not aligned377cs_b2f_src_u:378bic from, #3379.align 3380cs_b2f_16_loop_u:381subs r2, #16382blt cs_b2f_16_loop_u_finished383ldr r7, [from]384mov r3, r7385ldmdb from!, {r4 - r7}386mov r4, r4, lsr #16387orr r4, r4, r5, lsl #16388pld [from, #-32]389mov r5, r5, lsr #16390orr r5, r5, r6, lsl #16391mov r6, r6, lsr #16392orr r6, r6, r7, lsl #16393mov r7, r7, lsr #16394orr r7, r7, r3, lsl #16395stmdb to!, {r4 - r7}396bgt cs_b2f_16_loop_u397beq conjoint_shorts_finish398cs_b2f_16_loop_u_finished:399addslt r2, #16400ldr r3, [from]401cmp r2, #10402blt cs_b2f_2_u_loop403ldmdb from!, {r4 - r5}404mov r6, r4, lsr #16405orr r6, r6, r5, lsl #16406mov r7, r5, lsr #16407orr r7, r7, r3, lsl #16408stmdb to!, {r6-r7}409sub r2, #8410.align 3411cs_b2f_2_u_loop:412subs r2, #2413ldrh r3, [from], #-2414strh r3, [to, #-2]!415bgt cs_b2f_2_u_loop416417conjoint_shorts_finish:418ldmia sp!, {r3 - r9, ip}419bx lr420421422# Support for void Copy::arrayof_conjoint_jshorts(void* from,423# void* to,424# size_t count)425_Copy_arrayof_conjoint_jshorts:426swi 0x9f0001427428# Support for void Copy::conjoint_jints_atomic(void* from,429# void* to,430# size_t count)431_Copy_conjoint_jints_atomic:432_Copy_arrayof_conjoint_jints:433swi 0x9f0001434435# Support for void Copy::conjoint_jlongs_atomic(jlong* from,436# jlong* to,437# size_t count)438_Copy_conjoint_jlongs_atomic:439_Copy_arrayof_conjoint_jlongs:440stmdb sp!, {r3 - r9, ip}441442cmp r2, #0443beq conjoint_longs_finish444445pld [from, #0]446cmp r2, #24447ble conjoint_longs_small448449subs r3, to, from450cmphi r2, r3451bhi cl_b2f_copy452.align 3453cl_f2b_loop_32:454subs r2, #32455blt cl_f2b_loop_32_finish456ldmia from!, {r3 - r9, ip}457nop458pld [from]459stmia to!, {r3 - r9, ip}460bgt cl_f2b_loop_32461cl_f2b_loop_32_finish:462addslt r2, #32463beq conjoint_longs_finish464conjoint_longs_small:465cmp r2, #16466blt cl_f2b_copy_8467bgt cl_f2b_copy_24468ldmia from!, {r3 - r6}469stmia to!, {r3 - r6}470b conjoint_longs_finish471cl_f2b_copy_8:472ldmia from!, {r3 - r4}473stmia to!, {r3 - r4}474b conjoint_longs_finish475cl_f2b_copy_24:476ldmia from!, {r3 - r8}477stmia to!, {r3 - r8}478b conjoint_longs_finish479480# Src and dest overlap, copy in a descending order481cl_b2f_copy:482add from, r2483pld [from, #-32]484add to, r2485.align 3486cl_b2f_loop_32:487subs r2, #32488blt cl_b2f_loop_32_finish489ldmdb from!, {r3 - r9, ip}490nop491pld [from]492stmdb to!, {r3 - r9, ip}493bgt cl_b2f_loop_32494cl_b2f_loop_32_finish:495addslt r2, #32496beq conjoint_longs_finish497cmp r2, #16498blt cl_b2f_copy_8499bgt cl_b2f_copy_24500ldmdb from!, {r3 - r6}501stmdb to!, {r3 - r6}502b conjoint_longs_finish503cl_b2f_copy_8:504ldmdb from!, {r3 - r4}505stmdb to!, {r3 - r4}506b conjoint_longs_finish507cl_b2f_copy_24:508ldmdb from!, {r3 - r8}509stmdb to!, {r3 - r8}510511conjoint_longs_finish:512ldmia sp!, {r3 - r9, ip}513bx lr514515516517518