Skip to content

Commit

Permalink
aarch64: implement smsubl and umsubl
Browse files Browse the repository at this point in the history
  • Loading branch information
kristerw committed Oct 20, 2024
1 parent 7ade0ff commit 753c329
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/read_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ struct Parser {
void process_min_max(Op op);
void process_mul_op(Op op);
void process_maddl(Op op);
void process_msubl(Op op);
void process_mull(Op op);
void process_mulh(Op op);
void process_abs();
Expand Down Expand Up @@ -1247,6 +1248,24 @@ void Parser::process_maddl(Op op)
write_reg(dest, res);
}

void Parser::process_msubl(Op op)
{
Inst *dest = get_reg(1);
get_comma(2);
Inst *arg1 = get_reg_value(3);
get_comma(4);
Inst *arg2 = get_reg_value(5);
get_comma(6);
Inst *arg3 = get_reg_value(7);
get_end_of_line(8);

arg1 = bb->build_inst(op, arg1, 64);
arg2 = bb->build_inst(op, arg2, 64);
Inst *res = bb->build_inst(Op::MUL, arg1, arg2);
res = bb->build_inst(Op::SUB, arg3, res);
write_reg(dest, res);
}

void Parser::process_mull(Op op)
{
Inst *dest = get_reg(1);
Expand Down Expand Up @@ -2207,12 +2226,16 @@ void Parser::parse_function()
process_binary(Op::MUL);
else if (name == "smaddl")
process_maddl(Op::SEXT);
else if (name == "smsubl")
process_msubl(Op::SEXT);
else if (name == "smull")
process_mull(Op::SEXT);
else if (name == "smulh")
process_mulh(Op::SEXT);
else if (name == "umaddl")
process_maddl(Op::ZEXT);
else if (name == "umsubl")
process_msubl(Op::ZEXT);
else if (name == "umull")
process_mull(Op::ZEXT);
else if (name == "umulh")
Expand Down

0 comments on commit 753c329

Please sign in to comment.