Skip to content

Commit 5c8e2bd

Browse files
jhuber6Icohedron
authored andcommitted
Revert "[libc][stdfix] Fix buildbot failure because of a typo. (llvm#126291)"
This reverts commit bada922. Revert "[libc][stdfix] Implement fixed point `countlsfx` functions in llvm-libc (llvm#125356)" This reverts commit f2a1103.
1 parent 0f7d719 commit 5c8e2bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3
-902
lines changed

libc/config/baremetal/arm/entrypoints.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -469,18 +469,6 @@ if(LIBC_COMPILER_HAS_FIXED_POINT)
469469
libc.src.stdfix.ukbits
470470
libc.src.stdfix.lkbits
471471
libc.src.stdfix.ulkbits
472-
libc.src.stdfix.countlshr
473-
libc.src.stdfix.countlsr
474-
libc.src.stdfix.countlslr
475-
libc.src.stdfix.countlshk
476-
libc.src.stdfix.countlsk
477-
libc.src.stdfix.countlslk
478-
libc.src.stdfix.countlsuhr
479-
libc.src.stdfix.countlsur
480-
libc.src.stdfix.countlsulr
481-
libc.src.stdfix.countlsuhk
482-
libc.src.stdfix.countlsuk
483-
libc.src.stdfix.countlsulk
484472
)
485473
endif()
486474

libc/config/baremetal/riscv/entrypoints.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -464,18 +464,6 @@ if(LIBC_COMPILER_HAS_FIXED_POINT)
464464
libc.src.stdfix.ukbits
465465
libc.src.stdfix.lkbits
466466
libc.src.stdfix.ulkbits
467-
libc.src.stdfix.countlshr
468-
libc.src.stdfix.countlsr
469-
libc.src.stdfix.countlslr
470-
libc.src.stdfix.countlshk
471-
libc.src.stdfix.countlsk
472-
libc.src.stdfix.countlslk
473-
libc.src.stdfix.countlsuhr
474-
libc.src.stdfix.countlsur
475-
libc.src.stdfix.countlsulr
476-
libc.src.stdfix.countlsuhk
477-
libc.src.stdfix.countlsuk
478-
libc.src.stdfix.countlsulk
479467
)
480468
endif()
481469

libc/config/linux/riscv/entrypoints.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -749,18 +749,6 @@ if(LIBC_COMPILER_HAS_FIXED_POINT)
749749
# TODO: https://github.com/llvm/llvm-project/issues/115778
750750
libc.src.stdfix.lkbits
751751
libc.src.stdfix.ulkbits
752-
libc.src.stdfix.countlshr
753-
libc.src.stdfix.countlsr
754-
libc.src.stdfix.countlslr
755-
libc.src.stdfix.countlshk
756-
libc.src.stdfix.countlsk
757-
libc.src.stdfix.countlslk
758-
libc.src.stdfix.countlsuhr
759-
libc.src.stdfix.countlsur
760-
libc.src.stdfix.countlsulr
761-
libc.src.stdfix.countlsuhk
762-
libc.src.stdfix.countlsuk
763-
libc.src.stdfix.countlsulk
764752
)
765753
endif()
766754

libc/config/linux/x86_64/entrypoints.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -874,18 +874,6 @@ if(LIBC_COMPILER_HAS_FIXED_POINT)
874874
libc.src.stdfix.ukbits
875875
libc.src.stdfix.lkbits
876876
libc.src.stdfix.ulkbits
877-
libc.src.stdfix.countlshr
878-
libc.src.stdfix.countlsr
879-
libc.src.stdfix.countlslr
880-
libc.src.stdfix.countlshk
881-
libc.src.stdfix.countlsk
882-
libc.src.stdfix.countlslk
883-
libc.src.stdfix.countlsuhr
884-
libc.src.stdfix.countlsur
885-
libc.src.stdfix.countlsulr
886-
libc.src.stdfix.countlsuhk
887-
libc.src.stdfix.countlsuk
888-
libc.src.stdfix.countlsulk
889877
)
890878
endif()
891879

libc/docs/headers/math/stdfix.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The following functions are included in the ISO/IEC TR 18037:2008 standard.
7373
+---------------+----------------+-------------+---------------+------------+----------------+-------------+----------------+-------------+---------------+------------+----------------+-------------+
7474
| \*bits | | | | | | | | | | | | |
7575
+---------------+----------------+-------------+---------------+------------+----------------+-------------+----------------+-------------+---------------+------------+----------------+-------------+
76-
| countls | |check| | |check| | |check| | |check| | |check| | |check| | |check| | |check| | |check| | |check| | |check| | |check| |
76+
| countls | | | | | | | | | | | | |
7777
+---------------+----------------+-------------+---------------+------------+----------------+-------------+----------------+-------------+---------------+------------+----------------+-------------+
7878
| divi | | | | | | | | | | | | |
7979
+---------------+----------------+-------------+---------------+------------+----------------+-------------+----------------+-------------+---------------+------------+----------------+-------------+

libc/include/stdfix.yaml

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -306,87 +306,3 @@ functions:
306306
arguments:
307307
- type: unsigned int
308308
guard: LIBC_COMPILER_HAS_FIXED_POINT
309-
- name: countlshr
310-
standards:
311-
- stdc_ext
312-
return_type: int
313-
arguments:
314-
- type: short fract
315-
guard: LIBC_COMPILER_HAS_FIXED_POINT
316-
- name: countlsr
317-
standards:
318-
- stdc_ext
319-
return_type: int
320-
arguments:
321-
- type: fract
322-
guard: LIBC_COMPILER_HAS_FIXED_POINT
323-
- name: countlslr
324-
standards:
325-
- stdc_ext
326-
return_type: int
327-
arguments:
328-
- type: long fract
329-
guard: LIBC_COMPILER_HAS_FIXED_POINT
330-
- name: countlshk
331-
standards:
332-
- stdc_ext
333-
return_type: int
334-
arguments:
335-
- type: short accum
336-
guard: LIBC_COMPILER_HAS_FIXED_POINT
337-
- name: countlsk
338-
standards:
339-
- stdc_ext
340-
return_type: int
341-
arguments:
342-
- type: accum
343-
guard: LIBC_COMPILER_HAS_FIXED_POINT
344-
- name: countlslk
345-
standards:
346-
- stdc_ext
347-
return_type: int
348-
arguments:
349-
- type: long accum
350-
guard: LIBC_COMPILER_HAS_FIXED_POINT
351-
- name: countlsuhr
352-
standards:
353-
- stdc_ext
354-
return_type: int
355-
arguments:
356-
- type: unsigned short fract
357-
guard: LIBC_COMPILER_HAS_FIXED_POINT
358-
- name: countlsur
359-
standards:
360-
- stdc_ext
361-
return_type: int
362-
arguments:
363-
- type: unsigned fract
364-
guard: LIBC_COMPILER_HAS_FIXED_POINT
365-
- name: countlsulr
366-
standards:
367-
- stdc_ext
368-
return_type: int
369-
arguments:
370-
- type: unsigned long fract
371-
guard: LIBC_COMPILER_HAS_FIXED_POINT
372-
- name: countlsuhk
373-
standards:
374-
- stdc_ext
375-
return_type: int
376-
arguments:
377-
- type: unsigned short accum
378-
guard: LIBC_COMPILER_HAS_FIXED_POINT
379-
- name: countlsuk
380-
standards:
381-
- stdc_ext
382-
return_type: int
383-
arguments:
384-
- type: unsigned accum
385-
guard: LIBC_COMPILER_HAS_FIXED_POINT
386-
- name: countlsulk
387-
standards:
388-
- stdc_ext
389-
return_type: int
390-
arguments:
391-
- type: unsigned long accum
392-
guard: LIBC_COMPILER_HAS_FIXED_POINT

libc/src/__support/fixed_point/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ add_header_library(
1919
libc.src.__support.macros.optimization
2020
libc.src.__support.CPP.type_traits
2121
libc.src.__support.CPP.bit
22-
libc.src.__support.CPP.limits
2322
libc.src.__support.math_extras
2423
)
2524

libc/src/__support/fixed_point/fx_bits.h

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111

1212
#include "include/llvm-libc-macros/stdfix-macros.h"
1313
#include "src/__support/CPP/bit.h"
14-
#include "src/__support/CPP/limits.h" // numeric_limits
1514
#include "src/__support/CPP/type_traits.h"
16-
#include "src/__support/macros/attributes.h" // LIBC_INLINE
17-
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
15+
#include "src/__support/macros/attributes.h" // LIBC_INLINE
16+
#include "src/__support/macros/config.h"
1817
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
1918
#include "src/__support/math_extras.h"
2019

@@ -51,12 +50,6 @@ template <typename T> struct FXBits {
5150
static constexpr StorageType SIGN_MASK =
5251
(fx_rep::SIGN_LEN == 0 ? 0 : StorageType(1) << SIGN_OFFSET);
5352

54-
// mask for <integral | fraction>
55-
static constexpr StorageType VALUE_MASK = INTEGRAL_MASK | FRACTION_MASK;
56-
57-
// mask for <sign | integral | fraction>
58-
static constexpr StorageType TOTAL_MASK = SIGN_MASK | VALUE_MASK;
59-
6053
public:
6154
LIBC_INLINE constexpr FXBits() = default;
6255

@@ -81,12 +74,6 @@ template <typename T> struct FXBits {
8174
return (value & INTEGRAL_MASK) >> INTEGRAL_OFFSET;
8275
}
8376

84-
// returns complete bitstring representation the fixed point number
85-
// the bitstring is of the form: padding | sign | integral | fraction
86-
LIBC_INLINE constexpr StorageType get_bits() {
87-
return (value & TOTAL_MASK) >> FRACTION_OFFSET;
88-
}
89-
9077
// TODO: replace bool with Sign
9178
LIBC_INLINE constexpr bool get_sign() {
9279
return static_cast<bool>((value & SIGN_MASK) >> SIGN_OFFSET);
@@ -176,25 +163,6 @@ template <typename T> LIBC_INLINE constexpr T round(T x, int n) {
176163
return bit_and((x + round_bit), rounding_mask);
177164
}
178165

179-
// count leading sign bits
180-
template <typename T>
181-
LIBC_INLINE constexpr cpp::enable_if_t<cpp::is_fixed_point_v<T>, int>
182-
countls(T f) {
183-
using FXRep = FXRep<T>;
184-
using BitType = typename FXRep::StorageType;
185-
using FXBits = FXBits<T>;
186-
187-
constexpr int CONTAIN_LEN = cpp::numeric_limits<BitType>::digits;
188-
constexpr int PADDING_LEN = CONTAIN_LEN - FXRep::TOTAL_LEN;
189-
190-
if constexpr (FXRep::SIGN_LEN != 0)
191-
if (f < 0)
192-
f = bit_not(f);
193-
194-
BitType value_bits = FXBits(f)::get_bits();
195-
return cpp::countl_zero(value_bits) - PADDING_LEN;
196-
}
197-
198166
} // namespace fixed_point
199167
} // namespace LIBC_NAMESPACE_DECL
200168

libc/src/stdfix/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,6 @@ foreach(suffix IN ITEMS hr r lr hk k lk uhr ur ulr uhk uk ulk)
5353
libc.src.__support.CPP.bit
5454
libc.src.__support.fixed_point.fx_bits
5555
)
56-
57-
add_entrypoint_object(
58-
countls${suffix}
59-
HDRS
60-
countls${suffix}.h
61-
SRCS
62-
countls${suffix}.cpp
63-
COMPILE_OPTIONS
64-
${libc_opt_high_flag}
65-
DEPENDS
66-
libc.src.__support.fixed_point.fx_bits
67-
)
6856
endforeach()
6957

7058
add_entrypoint_object(

libc/src/stdfix/countlshk.cpp

Lines changed: 0 additions & 20 deletions
This file was deleted.

libc/src/stdfix/countlshk.h

Lines changed: 0 additions & 21 deletions
This file was deleted.

libc/src/stdfix/countlshr.cpp

Lines changed: 0 additions & 20 deletions
This file was deleted.

libc/src/stdfix/countlshr.h

Lines changed: 0 additions & 21 deletions
This file was deleted.

libc/src/stdfix/countlsk.cpp

Lines changed: 0 additions & 18 deletions
This file was deleted.

libc/src/stdfix/countlsk.h

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)