From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [IPv6:2607:f8b0:400e:c03::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 395ED1A1E0B for ; Mon, 26 Sep 2016 15:59:21 -0700 (PDT) Received: by mail-pa0-x22a.google.com with SMTP id oz2so67340692pac.2 for ; Mon, 26 Sep 2016 15:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vHqCM4vsoxISaqW51o+2vaUFle6cNWrBBbK3m+WmkiY=; b=Hb06DC6xv/anG3d26cXKYonEoNDm2G7B7G6HVHTvI0WcCdhyLPHiQIyt/anmZ7kHGw cORPg9gIEhR57NIxXGmtkRQwdb6e9SgFgkHuq/n75upBCwgn3ZFrmEiwHzDlFH4RMoKU G+F0/oQHLQtQ3KCXtpTd74sHGE3blCML1IeSw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vHqCM4vsoxISaqW51o+2vaUFle6cNWrBBbK3m+WmkiY=; b=dRsHM6MQnceSTVEPnYVSz+og7ljYEJxKHzMtQ91FAyLnNr2jSDxMt/nJjdnbNKbwRE gJcAXFf6MBClmJcdEsgZLseBeONjEvEI1MxnJjlQUYHbujUiSiopwkPeT+RwteflnXH9 zCbrDOFuVZYocy/2DKGK50nn86Dz6zlWYPfew3UaWrXVtA4kEOb4zKajK0bVn1SmmGEH 8rumboafK5+EypJDVCgeEx5LqYCOC89HChVXOPUDTVHagIdTIAeeydwkhtJbCcgCq442 VHenlFHbIggUDcCaSi0QCIn8MeuXCBjmFhl6I3WlpnXQV3+8WRMyRKX3NLKY2QQ/RuPn r7aw== X-Gm-Message-State: AA6/9RlcyXrlTw2GIC3oP3F0Z/xtV+gnhCPt3rBq/k6IOlHp7OgDPbsshdzuAwxggTYO1pfR X-Received: by 10.66.144.41 with SMTP id sj9mr25326473pab.97.1474930760826; Mon, 26 Sep 2016 15:59:20 -0700 (PDT) Received: from localhost.localdomain ([67.238.99.186]) by smtp.gmail.com with ESMTPSA id d2sm27356238pfe.94.2016.09.26.15.59.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Sep 2016 15:59:20 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, liming.gao@intel.com Cc: leif.lindholm@linaro.org, Ard Biesheuvel Date: Mon, 26 Sep 2016 15:59:16 -0700 Message-Id: <1474930756-6536-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474930756-6536-1-git-send-email-ard.biesheuvel@linaro.org> References: <1474930756-6536-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [PATCH 2/2] MdePkg/BaseMemoryLibOptDxe: replace deprecated uses of IT blocks X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2016 22:59:21 -0000 The ARM architecture version 8 deprecates all uses of the IT instruction except cases where it is followed by a single narrow instruction. So replace any occurrences with equivalent sequences that adhere to the new rules. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- .../Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S | 6 ++--- .../Library/BaseMemoryLibOptDxe/Arm/CompareMem.S | 2 +- MdePkg/Library/BaseMemoryLibOptDxe/Arm/CopyMem.S | 31 ++++++++++++---------- MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.S | 9 ++++--- MdePkg/Library/BaseMemoryLibOptDxe/Arm/SetMem.S | 12 +++++---- 5 files changed, 33 insertions(+), 27 deletions(-) diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S index d729994e8cc6..6d0089049d48 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S +++ b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S @@ -42,7 +42,7 @@ ASM_PFX(InternalMemCompareGuid): ldr lr, [r1, #4] cmp r2, ip it eq - cmpeq r3, lr + cmpeq.n r3, lr beq 0f movs r0, #0 pop {r4, pc} @@ -51,7 +51,7 @@ ASM_PFX(InternalMemCompareGuid): ldr r3, [r1, #12] cmp r4, r2 it eq - cmpeq r0, r3 + cmpeq.n r0, r3 bne 2f movs r0, #1 pop {r4, pc} @@ -61,5 +61,5 @@ ASM_PFX(InternalMemCompareGuid): movs r0, #1 orrs r2, r2, r4 2: it ne - movne r0, #0 + movne.n r0, #0 pop {r4, pc} diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S index 3aadebace30f..9483aab61a0c 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S +++ b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S @@ -132,7 +132,7 @@ ASM_PFX(InternalMemCompareMem): ldrb data2, [src2], #1 subs limit, limit, #1 it cs - cmpcs data1, data2 + cmpcs.n data1, data2 beq 1b sub result, data1, data2 pop {r4-r8, pc} diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CopyMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CopyMem.S index fb5293befc10..195a0b23f770 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CopyMem.S +++ b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CopyMem.S @@ -65,16 +65,18 @@ memcopy_check_optim_default: // Check if we can use an optimized path ((length >= 32) && destination word-aligned && source word-aligned) for the memcopy (optimized path if r0 == 1) tst r0, #0xF it ne - movne r0, #0 + movne.n r0, #0 bne memcopy_default tst r1, #0xF - ite ne - movne r3, #0 - moveq r3, #1 + it ne + movne.n r3, #0 + it eq + moveq.n r3, #1 cmp r2, #31 - ite ls - movls r0, #0 - andhi r0, r3, #1 + it ls + movls.n r0, #0 + bls memcopy_default + and r0, r3, #1 b memcopy_default memcopy_check_optim_overlap: @@ -84,15 +86,16 @@ memcopy_check_optim_overlap: // Are we in the optimized case ((length >= 32) && dest_end word-aligned && source_end word-aligned) cmp r2, #31 - ite ls - movls r0, #0 - movhi r0, #1 + it ls + movls.n r0, #0 + it hi + movhi.n r0, #1 tst r10, #0xF it ne - movne r0, #0 + movne.n r0, #0 tst r14, #0xF it ne - movne r0, #0 + movne.n r0, #0 b memcopy_overlapped memcopy_overlapped_non_optim: @@ -123,7 +126,7 @@ memcopy_overlapped: // If length is less than 32 then disable optim it ls - movls r0, #0 + movls.n r0, #0 cmp r12, #0 @@ -157,7 +160,7 @@ memcopy_default_loop: // If length is less than 32 then disable optim it ls - movls r0, #0 + movls.n r0, #0 cmp r12, #0 diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.S index 1c269547b072..5dcf153a61a9 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.S +++ b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.S @@ -123,11 +123,12 @@ ASM_PFX(InternalMemScanMem8): 60: // We're here because the fast path found a hit - now we have to track down exactly which word it was // r0 points to the start of the double word after the one that was tested // r5 has the 00/ff pattern for the first word, r6 has the chained value + subs r0, r0, #3 cmp r5, #0 - itte eq - moveq r5, r6 // the end is in the 2nd word - subeq r0, r0, #3 // Points to 2nd byte of 2nd word - subne r0, r0, #7 // or 2nd byte of 1st word + it eq + moveq.n r5, r6 // the end is in the 2nd word + it ne + subne.n r0, r0, #4 // or 2nd byte of 1st word // r0 currently points to the 3rd byte of the word containing the hit tst r5, #CHARTSTMASK(0) // 1st character diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/SetMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/SetMem.S index add04443b2e9..2d8f4d5b8621 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/SetMem.S +++ b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/SetMem.S @@ -73,15 +73,17 @@ ASM_PFX(InternalMemZeroMem): cmp r4, #4 // between 4 and 15 bytes? blt 4f cmp r4, #8 // between 8 and 15 bytes? - str r2, [lr, #-16] // overlapping store of 4 + (4 + 4) + 4 bytes - itt gt - strgt r3, [lr, #-12] - strgt r2, [r1] + sub r4, lr, #16 + str r2, [r4] // overlapping store of 4 + (4 + 4) + 4 bytes + it gt + strgt.n r3, [r4, #4] + it gt + strgt.n r2, [r1] str r3, [r1, #4] pop {r4, pc} 4: cmp r4, #2 // 2 or 3 bytes? strb r2, [lr, #-16] // store 1 byte it ge - strhge r2, [r1, #6] // store 2 bytes + strhge.n r2, [r1, #6] // store 2 bytes pop {r4, pc} -- 2.7.4