From 03f168094dc99850b54a6304036020b82cd727e2 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Tue, 20 Dec 2016 22:05:51 +0000 Subject: [PATCH] emit_x64: Document ExtractMostSignificantBitFromPackedBytes --- src/backend_x64/emit_x64.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/backend_x64/emit_x64.cpp b/src/backend_x64/emit_x64.cpp index 4c7d00e8..8ffd57e9 100644 --- a/src/backend_x64/emit_x64.cpp +++ b/src/backend_x64/emit_x64.cpp @@ -1348,6 +1348,15 @@ void EmitX64::EmitSignedSaturatedSub(IR::Block& block, IR::Inst* inst) { } } +/** + * Extracts the most significant bits from each of the packed bytes, and packs them together. + * + * value before: a-------b-------c-------d------- + * value after: 0000000000000000000000000000abcd + * + * @param value The register containing the value to operate on. Result will be stored in the same register. + * @param a_tmp A register which can be used as a scratch register. + */ static void ExtractMostSignificantBitFromPackedBytes(const Xbyak::util::Cpu& cpu_info, BlockOfCode* code, RegAlloc& reg_alloc, Xbyak::Reg32 value, boost::optional a_tmp = boost::none) { if (cpu_info.has(Xbyak::util::Cpu::tBMI2)) { Xbyak::Reg32 tmp = a_tmp ? *a_tmp : reg_alloc.ScratchGpr().cvt32();