Skip to content

fix function signature of v128.pmin, v128.pmax #2379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

JesseCodeBones
Copy link
Contributor

according to the source code of builtin_v128_pmin and builtin_v128_pmax.
they only accept the f32 and f64 format, change the function signature according to its source code.

  if (type.isValue) {
    switch (type.kind) {
      case TypeKind.F32: return module.binary(BinaryOp.PminF32x4, arg0, arg1);
      case TypeKind.F64: return module.binary(BinaryOp.PminF64x2, arg0, arg1);
    }
  }
  compiler.error(
    DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
    ctx.reportNode.typeArgumentsRange, "v128.pmin", type.toString()
  );

this issue found from issue 2374

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@MaxGraey
Copy link
Member

Thanks for PR. I'm wondering why all your PRs started as "Optimize ..." while it just fixes, some improvements in tests or type definitions? =) It's a little confusing.

@JesseCodeBones JesseCodeBones changed the title Optimize function signature of v128.pmin, v128.pmax fix function signature of v128.pmin, v128.pmax Jul 22, 2022
@JesseCodeBones
Copy link
Contributor Author

yes, OK, I will add tests and change the title

@JesseCodeBones JesseCodeBones force-pushed the issue-2374-incorrect-fun-template branch 3 times, most recently from 3277cd4 to bbad36d Compare July 22, 2022 07:20
@JesseCodeBones
Copy link
Contributor Author

JesseCodeBones commented Jul 22, 2022

@MaxGraey
Hi Max,
I am not familiar the wat generation flow, now it should be OK, please kindly review.

@JesseCodeBones JesseCodeBones force-pushed the issue-2374-incorrect-fun-template branch from bbad36d to 9ec3507 Compare July 22, 2022 07:32
@JesseCodeBones JesseCodeBones force-pushed the issue-2374-incorrect-fun-template branch from 9ec3507 to 2a68d6c Compare July 22, 2022 07:37
@JesseCodeBones JesseCodeBones force-pushed the issue-2374-incorrect-fun-template branch from 2a68d6c to 1b3f5dc Compare July 22, 2022 08:01
@MaxGraey MaxGraey merged commit 79d2e6a into AssemblyScript:main Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants