Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Unified Diff: src/arm/macro-assembler-arm.cc

Issue 2639443002: [ARM] Refactor NEON binary ops in assembler. (Closed)
Patch Set: Make NeonDataType match NeonSize. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/constants-arm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/macro-assembler-arm.cc
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc
index c3d825b87bb02d50542c2dc8cb81119be76e9b78..ea0c4cb1d6759bffbab56cc2001e6b83e3d6c4ba 100644
--- a/src/arm/macro-assembler-arm.cc
+++ b/src/arm/macro-assembler-arm.cc
@@ -1146,12 +1146,11 @@ void MacroAssembler::VmovExtended(const MemOperand& dst, int src_code,
void MacroAssembler::ExtractLane(Register dst, QwNeonRegister src,
NeonDataType dt, int lane) {
- int bytes_per_lane = dt & NeonDataTypeSizeMask; // 1, 2, 4
- int log2_bytes_per_lane = bytes_per_lane / 2; // 0, 1, 2
- int byte = lane << log2_bytes_per_lane;
+ int size = NeonSz(dt); // 0, 1, 2
+ int byte = lane << size;
int double_word = byte >> kDoubleSizeLog2;
int double_byte = byte & (kDoubleSize - 1);
- int double_lane = double_byte >> log2_bytes_per_lane;
+ int double_lane = double_byte >> size;
DwVfpRegister double_source =
DwVfpRegister::from_code(src.code() * 2 + double_word);
vmov(dt, dst, double_source, double_lane);
@@ -1166,12 +1165,11 @@ void MacroAssembler::ExtractLane(SwVfpRegister dst, QwNeonRegister src,
void MacroAssembler::ReplaceLane(QwNeonRegister dst, QwNeonRegister src,
Register src_lane, NeonDataType dt, int lane) {
Move(dst, src);
- int bytes_per_lane = dt & NeonDataTypeSizeMask; // 1, 2, 4
- int log2_bytes_per_lane = bytes_per_lane / 2; // 0, 1, 2
- int byte = lane << log2_bytes_per_lane;
+ int size = NeonSz(dt); // 0, 1, 2
+ int byte = lane << size;
int double_word = byte >> kDoubleSizeLog2;
int double_byte = byte & (kDoubleSize - 1);
- int double_lane = double_byte >> log2_bytes_per_lane;
+ int double_lane = double_byte >> size;
DwVfpRegister double_dst =
DwVfpRegister::from_code(dst.code() * 2 + double_word);
vmov(dt, double_dst, double_lane, src_lane);
« no previous file with comments | « src/arm/constants-arm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698