zclllyybb commented on code in PR #31583:
URL: https://github.com/apache/doris/pull/31583#discussion_r1509923206


##########
be/src/vec/functions/round.h:
##########
@@ -217,75 +230,30 @@ class BaseFloatRoundingComputation<Float64> {
     static VectorType divide(VectorType val, VectorType scale) { return 
_mm_div_pd(val, scale); }
     template <RoundingMode mode>
     static VectorType apply(VectorType val) {
-        return _mm_round_pd(val, int(mode));
+        if constexpr (mode != RoundingMode::Round) {
+            return _mm_round_pd(val, int(mode));
+        }
+        VectorType result;
+        Float64 input_values[2];
+        _mm_storeu_pd(input_values, val);
+        if constexpr (tie_breaking_mode == TieBreakingMode::Bankers) {
+            result = _mm_set_pd(std::nearbyint(input_values[1]), 
std::nearbyintf(input_values[0]));

Review Comment:
   `_mm_set_pd` is a sequence instruction. since you have put the input values 
in contiguous places(`input_values`), don't use this, but use `_mm_loadu_pd`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to