Skip to content

[libc] Add definitions for totalordermag(,f, l, f128), dsqrt(l, f128), fsqrt(, l, f128) to math.yaml. #103494

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
merged 3 commits into from
Aug 14, 2024

Conversation

wldfngrs
Copy link
Contributor

Added auto function hdrgen specification for functions: totalordermagf, dsqrtl, fsqrt, fsqrtl

…talordermag, totalordermagf, dsqrtl, fsqrt, fsqrtl
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added the libc label Aug 14, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 14, 2024

@llvm/pr-subscribers-libc

Author: wldfngrs (wldfngrs)

Changes

Added auto function hdrgen specification for functions: totalordermagf, dsqrtl, fsqrt, fsqrtl


Full diff: https://github.com/llvm/llvm-project/pull/103494.diff

1 Files Affected:

  • (modified) libc/newhdrgen/yaml/math.yaml (+39)
diff --git a/libc/newhdrgen/yaml/math.yaml b/libc/newhdrgen/yaml/math.yaml
index f839552258912..dc3cde963162a 100644
--- a/libc/newhdrgen/yaml/math.yaml
+++ b/libc/newhdrgen/yaml/math.yaml
@@ -214,6 +214,12 @@ functions:
     arguments:
       - type: long double
       - type: long double
+  - name: dsqrtl
+    standards:
+      - stdc
+    return_type: double
+    arguments:
+      - type: long double
   - name: erff
     standards:
       - stdc
@@ -1195,6 +1201,18 @@ functions:
       - type: long double
       - type: int
       - type: unsigned int
+  - name: fsqrt
+    standards:
+      - stdc
+    return_type: float type
+    arguments:
+      - type: double
+  - name: fsqrtl
+    standards:
+      - stdc
+    return_type: float
+    arguments:
+      - type: long double 
   - name: fsub
     standards:
       - stdc
@@ -2323,6 +2341,27 @@ functions:
     arguments:
       - type: const long double *
       - type: const long double *
+  - name: totalordermag
+    standards:
+      - stdc
+    return_type: int
+    arguments:
+      - type: double *
+      - type: double *
+  - name: totalordermagf
+    standards:
+      - stdc
+    return_type: int
+    arguments:
+      - type: float *
+      - type: float *
+  - name: totalordermagl
+    standards:
+      - stdc
+    return_type: int
+    arguments:
+      - type: long double *
+      - type: long double *
   - name: totalordermagf16
     standards:
       - stdc

@wldfngrs
Copy link
Contributor Author

@lntue PR for review, thanks!

@jhuber6 jhuber6 changed the title math.yaml update [libc] Add definitions for totalordermagf, dsqrtl, fsqrt, and fsqrtl Aug 14, 2024
@jhuber6
Copy link
Contributor

jhuber6 commented Aug 14, 2024

For now, we probably need to add these to spec/stdc.td as well since we're in-between formats. Also, do we have implementations for these?

@lntue
Copy link
Contributor

lntue commented Aug 14, 2024

For now, we probably need to add these to spec/stdc.td as well since we're in-between formats. Also, do we have implementations for these?

Those functions were implemented and only added to spec/stdc.td, spec/llvm_libc_ext.td, but not math.yaml.

@wldfngrs
Copy link
Contributor Author

@lntue Made a commit adding the function definitions suggested

@lntue lntue changed the title [libc] Add definitions for totalordermagf, dsqrtl, fsqrt, and fsqrtl [libc] Add definitions for totalordermag(,f, l, f128), dsqrt(l, f128), fsqrt(, l, f128) to math.yaml. Aug 14, 2024
@lntue lntue merged commit f53e355 into llvm:main Aug 14, 2024
6 checks passed
Copy link

@wldfngrs Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

Your changes will be combined with recent changes from other authors, then tested
by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as
the builds can include changes from many authors. It is not uncommon for your
change to be included in a build that fails due to someone else's changes, or
infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail here.

If your change does cause a problem, it may be reverted, or you can revert it yourself.
This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are working as expected, well done!

@wldfngrs wldfngrs deleted the hdrgenmod branch August 14, 2024 12:26
Comment on lines +2359 to +2387
- name: totalordermag
standards:
- stdc
return_type: int
arguments:
- type: double *
- type: double *
- name: totalordermagf
standards:
- stdc
return_type: int
arguments:
- type: float *
- type: float *
- name: totalordermagl
standards:
- stdc
return_type: int
arguments:
- type: long double *
- type: long double *
- name: totalordermagf128
standards:
- stdc
return_type: int
arguments:
- type: float128 *
- type: float128 *
guard: LIBC_TYPES_HAS_FLOAT128
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totalordermag* functions take pointers to const values. See section F.10.12.2 of https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #103935.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants