Skip to content

Commit

Permalink
power: native division support
Browse files Browse the repository at this point in the history
  • Loading branch information
eshoguli committed Jul 28, 2024
1 parent 1c05174 commit 59198bd
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,7 @@ void jit_power_static_emitter::register_table_entries() {
push_arg_entry_of("power", float2int(power, exec_prc_), true, exec_prc_);
push_arg_entry_of("scale", float2int(scale, exec_prc_), true, exec_prc_);
push_arg_entry_of("shift", float2int(shift, exec_prc_), true, exec_prc_);
push_arg_entry_of("one", float2int(1.f, exec_prc_), true, exec_prc_);
}

std::set<std::vector<element::Type>> jit_power_static_emitter::get_supported_precisions(const std::shared_ptr<ov::Node>& node) {
Expand Down Expand Up @@ -1350,6 +1351,13 @@ void jit_power_static_emitter::emit_isa(const std::vector<size_t> &in_vec_idxs,
return;
}

if (power == -1.f) {
auto adr = table_val2("one");
h->ld1r(aux, adr);
h->fdiv(dst, aux, src());
return;
}

if (std::floor(power) == power && power > 0) {
h->mov(BReg(aux.getIdx()), BReg(src().getIdx()));
h->fmov(dst, 1.);
Expand Down

0 comments on commit 59198bd

Please sign in to comment.