mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 09:04:05 +02:00
parent
e1d09ffe5d
commit
d0fdbef4ea
3 changed files with 23 additions and 15 deletions
|
@ -586,7 +586,8 @@ static inline unsigned char search_ascii_only_escape(search_state *search, const
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void full_escape_UTF8_char(search_state *search, unsigned char ch_len) {
|
static inline void full_escape_UTF8_char(search_state *search, unsigned char ch_len)
|
||||||
|
{
|
||||||
const unsigned char ch = (unsigned char)*search->ptr;
|
const unsigned char ch = (unsigned char)*search->ptr;
|
||||||
switch (ch_len) {
|
switch (ch_len) {
|
||||||
case 1: {
|
case 1: {
|
||||||
|
@ -776,7 +777,8 @@ static VALUE mHash_to_json(int argc, VALUE *argv, VALUE self)
|
||||||
* _state_ is a JSON::State object, that can also be used to configure the
|
* _state_ is a JSON::State object, that can also be used to configure the
|
||||||
* produced JSON string output further.
|
* produced JSON string output further.
|
||||||
*/
|
*/
|
||||||
static VALUE mArray_to_json(int argc, VALUE *argv, VALUE self) {
|
static VALUE mArray_to_json(int argc, VALUE *argv, VALUE self)
|
||||||
|
{
|
||||||
rb_check_arity(argc, 0, 1);
|
rb_check_arity(argc, 0, 1);
|
||||||
VALUE Vstate = cState_from_state_s(cState, argc == 1 ? argv[0] : Qnil);
|
VALUE Vstate = cState_from_state_s(cState, argc == 1 ? argv[0] : Qnil);
|
||||||
return cState_partial_generate(Vstate, self, generate_json_array, Qfalse);
|
return cState_partial_generate(Vstate, self, generate_json_array, Qfalse);
|
||||||
|
@ -838,7 +840,8 @@ static VALUE mFloat_to_json(int argc, VALUE *argv, VALUE self)
|
||||||
*
|
*
|
||||||
* Extends _modul_ with the String::Extend module.
|
* Extends _modul_ with the String::Extend module.
|
||||||
*/
|
*/
|
||||||
static VALUE mString_included_s(VALUE self, VALUE modul) {
|
static VALUE mString_included_s(VALUE self, VALUE modul)
|
||||||
|
{
|
||||||
VALUE result = rb_funcall(modul, i_extend, 1, mString_Extend);
|
VALUE result = rb_funcall(modul, i_extend, 1, mString_Extend);
|
||||||
rb_call_super(1, &modul);
|
rb_call_super(1, &modul);
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -18,7 +18,8 @@ typedef enum {
|
||||||
#define HAVE_BUILTIN_CTZLL 0
|
#define HAVE_BUILTIN_CTZLL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline uint32_t trailing_zeros64(uint64_t input) {
|
static inline uint32_t trailing_zeros64(uint64_t input)
|
||||||
|
{
|
||||||
#if HAVE_BUILTIN_CTZLL
|
#if HAVE_BUILTIN_CTZLL
|
||||||
return __builtin_ctzll(input);
|
return __builtin_ctzll(input);
|
||||||
#else
|
#else
|
||||||
|
@ -32,7 +33,8 @@ static inline uint32_t trailing_zeros64(uint64_t input) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int trailing_zeros(int input) {
|
static inline int trailing_zeros(int input)
|
||||||
|
{
|
||||||
#if HAVE_BUILTIN_CTZLL
|
#if HAVE_BUILTIN_CTZLL
|
||||||
return __builtin_ctz(input);
|
return __builtin_ctz(input);
|
||||||
#else
|
#else
|
||||||
|
@ -59,7 +61,8 @@ static inline int trailing_zeros(int input) {
|
||||||
#include <arm_neon.h>
|
#include <arm_neon.h>
|
||||||
|
|
||||||
#define FIND_SIMD_IMPLEMENTATION_DEFINED 1
|
#define FIND_SIMD_IMPLEMENTATION_DEFINED 1
|
||||||
static inline SIMD_Implementation find_simd_implementation(void) {
|
static inline SIMD_Implementation find_simd_implementation(void)
|
||||||
|
{
|
||||||
return SIMD_NEON;
|
return SIMD_NEON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +164,8 @@ static inline TARGET_SSE2 FORCE_INLINE int string_scan_simd_sse2(const char **pt
|
||||||
#include <cpuid.h>
|
#include <cpuid.h>
|
||||||
#endif /* HAVE_CPUID_H */
|
#endif /* HAVE_CPUID_H */
|
||||||
|
|
||||||
static inline SIMD_Implementation find_simd_implementation(void) {
|
static inline SIMD_Implementation find_simd_implementation(void)
|
||||||
|
{
|
||||||
// TODO Revisit. I think the SSE version now only uses SSE2 instructions.
|
// TODO Revisit. I think the SSE version now only uses SSE2 instructions.
|
||||||
if (__builtin_cpu_supports("sse2")) {
|
if (__builtin_cpu_supports("sse2")) {
|
||||||
return SIMD_SSE2;
|
return SIMD_SSE2;
|
||||||
|
@ -176,7 +180,8 @@ static inline SIMD_Implementation find_simd_implementation(void) {
|
||||||
#endif /* JSON_ENABLE_SIMD */
|
#endif /* JSON_ENABLE_SIMD */
|
||||||
|
|
||||||
#ifndef FIND_SIMD_IMPLEMENTATION_DEFINED
|
#ifndef FIND_SIMD_IMPLEMENTATION_DEFINED
|
||||||
static inline SIMD_Implementation find_simd_implementation(void) {
|
static inline SIMD_Implementation find_simd_implementation(void)
|
||||||
|
{
|
||||||
return SIMD_NONE;
|
return SIMD_NONE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue