Commit Graph

4 Commits

Author SHA1 Message Date
Tue Ly
6edad0c8f0 [libc][RISCV] Let RISCV64 targets test implementations with and without FMA.
Let RISCV64 targets math implementations with and without FMA
automatically.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D146730
2023-04-06 09:23:48 -04:00
Tue Ly
ed261e7106 [libc] Add float type and flag for nearest_integer to enable SSE4.2.
Add float type and flag for nearest integer to automatically test with
and without SSE4.2 flag.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D129916
2022-07-22 09:29:41 -04:00
Tue Ly
614567a7bf [libc] Automatically add -mfma flag for architectures supporting FMA.
Detect if the architecture supports FMA instructions and if
the targets depend on fma.

Reviewed By: gchatelet

Differential Revision: https://reviews.llvm.org/D123615
2022-06-03 01:21:20 -04:00
Tue Ly
800051487f [libc] Implement FLAGS option for generating all combinations for targets.
Add FLAGS option for add_header_library, add_object_library,
add_entrypoint_object, and add_libc_unittest.

In general, a flag is a string provided for supported functions under the
multi-valued option `FLAGS`.  It should be one of the following forms:
  FLAG_NAME
  FLAG_NAME__NO
  FLAG_NAME__ONLY
A target will inherit all the flags of its upstream dependency.

When we create a target `TARGET_NAME` with a flag using (add_header_library,
add_object_library, ...), its behavior will depend on the flag form as follow:
- FLAG_NAME: The following 2 targets will be generated:
    `TARGET_NAME` that has `FLAG_NAME` in its `FLAGS` property.
    `TARGET_NAME.__NO_FLAG_NAME` that depends on `DEP.__NO_FLAG_NAME` if
       `TARGET_NAME` depends on `DEP` and `DEP` has `FLAG_NAME` in its `FLAGS`
       property.
- FLAG_NAME__ONLY: Only generate 1 target `TARGET_NAME` that has `FLAG_NAME`
    in its `FLAGS` property.
- FLAG_NAME__NO: Only generate 1 target `TARGET_NAME.__NO_FLAG_NAME` that
    depends on `DEP.__NO_FLAG_NAME` if `DEP` is in its DEPENDS list and `DEP`
    has `FLAG_NAME` in its `FLAGS` property.

To show all the targets generated, pass SHOW_INTERMEDIATE_OBJECTS=ON to cmake.
To show all the targets' dependency and flags, pass
`SHOW_INTERMEDIATE_OBJECTS=DEPS` to cmake.

To completely disable a flag FLAG_NAME expansion, set the variable
`SKIP_FLAG_EXPANSION_FLAG_NAME=TRUE`.

Reviewed By: michaelrj, sivachandra

Differential Revision: https://reviews.llvm.org/D125174
2022-06-01 00:54:07 -04:00