Skip to content

Commit bb3ecc4

Browse files
committed
src: cpu: conv: jit_uni_x8s8s32x: dst scale: reuse vmm register
1 parent d721767 commit bb3ecc4

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/cpu/x64/jit_uni_x8s8s32x_conv_kernel.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2019-2022 Intel Corporation
2+
* Copyright 2019-2023 Intel Corporation
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -900,16 +900,14 @@ void _jit_uni_x8s8s32x_fwd_kernel<isa, Vmm>::generate() {
900900

901901
if (jcp.is_depthwise) {
902902
const bool is_zero_point = jcp.src_zero_point || jcp.dst_zero_point;
903-
// dst zero point and dst scale reuse the same register
904-
int idx = ker_max_reg + 1 - jcp.max_regs_ur
905-
- nstl::max(2 * is_zero_point, static_cast<int>(jcp.dst_scale));
903+
int idx = ker_max_reg + 1 - jcp.max_regs_ur - 2 * is_zero_point;
906904
if (!jcp.is_resrc_depthwise) vmm_dw_src = Vmm(--idx);
907905
if (!jcp.has_vnni) vmm_dw_tmp = Vmm(--idx);
908906
if (jcp.signed_input) {
909907
--idx; // due to extra register used for compensations
910908
}
911-
assert(IMPLICATION(!jcp.dst_scale && !is_zero_point,
912-
idx == ker_max_reg - ker_dw_reg_base_idx));
909+
assert(IMPLICATION(
910+
!is_zero_point, idx == ker_max_reg - ker_dw_reg_base_idx));
913911
}
914912

915913
if (!jcp.is_depthwise && (!jcp.has_vnni)) {
@@ -1359,7 +1357,6 @@ status_t jit_uni_x8s8s32x_fwd_kernel<isa>::init_conf(jit_conv_conf_t &jcp,
13591357
jcp.max_regs_ur = jcp.has_vnni ? 15 - jcp.signed_input : 12;
13601358
}
13611359

1362-
if (jcp.dst_scale) jcp.max_regs_ur = 10;
13631360
if (jcp.src_zero_point || jcp.dst_zero_point) jcp.max_regs_ur = 9;
13641361

13651362
auto set_or_check_wei_format = [&]() {

src/cpu/x64/jit_uni_x8s8s32x_conv_kernel.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2019-2022 Intel Corporation
2+
* Copyright 2019-2023 Intel Corporation
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -113,7 +113,7 @@ struct _jit_uni_x8s8s32x_fwd_kernel : public jit_generator {
113113
const Vmm vmm_zp_comp = vmm_zp_one;
114114
const Vmm vmm_zp_dw_tmp = vmm_zp_one;
115115
/* dst scale */
116-
const Vmm vmm_dst_scale = Vmm(5);
116+
const Vmm vmm_dst_scale = Vmm(0);
117117

118118
/* used in compute_ker (but set during prepare_output) */
119119
const Vmm vmm_shift = Vmm(1); // only for signed input

0 commit comments

Comments
 (0)