-
Notifications
You must be signed in to change notification settings - Fork 102
Conversation
8988118
to
c7119b9
Compare
@beetrees I'm still working on some better naming cleanup / docs / comments, but you may want to take a look at this. Basically migrating from always relying on macro expansion to putting everything into a trait, which should help avoid string matching problems (like you pointed out on a different PR). None of the possible refactoring of ULP / precision is done here. |
31d9d12
to
0163edc
Compare
0163edc
to
beb7240
Compare
7f1985b
to
456dac6
Compare
Let me know if you have any name suggestions too. I feel like too much here is some variation of "function" or "op", but I can't come up with anything much better. |
ddeb524
to
440d72f
Compare
Currently the macro always provides `CFn`, `RustFn`, `RustArgs`, etc. Change this so that: 1. This information must be explicily requested in the invocation. 2. There is a new `FTy` field available that emits a single float type, rather than a tuple or signature. Additionally, add two new macros that create enums representing function names.
403b95b
to
7081592
Compare
This contains: 1. Per-function and per-operation enums created by the proc macro 2. The `MathOp` trait which is implemented once per struct representing a function 3. Submodules for each function, each containing a `Routine` struct that implements `MathOp`
7081592
to
7c41830
Compare
I still don't have great names but I added the following to hopefully disambiguate a bit libm/crates/libm-test/src/op.rs Lines 6 to 14 in 7c41830
|
I think the naming here is always going to be somewhat arbitrary, but I think what you've gone with is perfectly reasonable terminology (I don't have any unequivocally better ideas). The most important thing (which I can see you have done) is to make sure it's documented. |
Migrate types from a macro to a trait
This allows us to move a lot of logic out of macros and into generic functions, which is a nice cleanup and much better for usability.