emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp 92fe7a9 2/3: * Remove unnecessary function 'emit_rva


From: Andrea Corallo
Subject: feature/native-comp 92fe7a9 2/3: * Remove unnecessary function 'emit_rvalue_from_unsigned_long_long'
Date: Fri, 19 Feb 2021 17:02:58 -0500 (EST)

branch: feature/native-comp
commit 92fe7a91f4c88bb8661d4f1f15739849ddc01754
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * Remove unnecessary function 'emit_rvalue_from_unsigned_long_long'
    
        * src/comp.c (emit_rvalue_from_unsigned_long_long): Remove
        function.
        (emit_rvalue_from_emacs_uint, emit_rvalue_from_lisp_word_tag)
        (emit_rvalue_from_lisp_word): Make use of
        'emit_rvalue_from_long_long'.
---
 src/comp.c | 50 +++-----------------------------------------------
 1 file changed, 3 insertions(+), 47 deletions(-)

diff --git a/src/comp.c b/src/comp.c
index ca6e990..24c40f7 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -1128,56 +1128,12 @@ emit_rvalue_from_long_long (gcc_jit_type *type, long 
long n)
        low));
 }
 
-#if (EMACS_INT_MAX > LONG_MAX)
-static gcc_jit_rvalue *
-emit_rvalue_from_unsigned_long_long (gcc_jit_type *type, unsigned long long n)
-{
-  emit_comment (format_string ("emit unsigned long long: %llu", n));
-
-  gcc_jit_rvalue *high =
-    gcc_jit_context_new_rvalue_from_long (comp.ctxt,
-                                         comp.unsigned_long_long_type,
-                                         n >> 32);
-  gcc_jit_rvalue *low =
-    emit_binary_op (GCC_JIT_BINARY_OP_RSHIFT,
-                   comp.unsigned_long_long_type,
-                   emit_binary_op (GCC_JIT_BINARY_OP_LSHIFT,
-                                   comp.unsigned_long_long_type,
-                                   gcc_jit_context_new_rvalue_from_long (
-                                     comp.ctxt,
-                                     comp.unsigned_long_long_type,
-                                     n),
-                                   gcc_jit_context_new_rvalue_from_int (
-                                     comp.ctxt,
-                                     comp.unsigned_long_long_type,
-                                     32)),
-                   gcc_jit_context_new_rvalue_from_int (
-                     comp.ctxt,
-                     comp.unsigned_long_long_type,
-                     32));
-
-  return emit_coerce (
-           type,
-           emit_binary_op (
-             GCC_JIT_BINARY_OP_BITWISE_OR,
-             comp.unsigned_long_long_type,
-             emit_binary_op (
-               GCC_JIT_BINARY_OP_LSHIFT,
-               comp.unsigned_long_long_type,
-               high,
-               gcc_jit_context_new_rvalue_from_int (comp.ctxt,
-                                                    
comp.unsigned_long_long_type,
-                                                    32)),
-             low));
-}
-#endif
-
 static gcc_jit_rvalue *
 emit_rvalue_from_emacs_uint (EMACS_UINT val)
 {
 #ifdef WIDE_EMACS_INT
   if (val > LONG_MAX || val < LONG_MIN)
-    return emit_rvalue_from_unsigned_long_long (comp.emacs_uint_type, val);
+    return emit_rvalue_from_long_long (comp.emacs_uint_type, val);
 #endif
   return gcc_jit_context_new_rvalue_from_long (comp.ctxt,
                                               comp.emacs_uint_type,
@@ -1199,7 +1155,7 @@ emit_rvalue_from_lisp_word_tag (Lisp_Word_tag val)
 {
 #ifdef WIDE_EMACS_INT
   if (val > LONG_MAX || val < LONG_MIN)
-    return emit_rvalue_from_unsigned_long_long (comp.lisp_word_tag_type, val);
+    return emit_rvalue_from_long_long (comp.lisp_word_tag_type, val);
 #endif
   return gcc_jit_context_new_rvalue_from_long (comp.ctxt,
                                               comp.lisp_word_tag_type,
@@ -1215,7 +1171,7 @@ emit_rvalue_from_lisp_word (Lisp_Word val)
                                               val);
 #else
   if (val > LONG_MAX || val < LONG_MIN)
-    return emit_rvalue_from_unsigned_long_long (comp.lisp_word_type, val);
+    return emit_rvalue_from_long_long (comp.lisp_word_type, val);
   else
     return gcc_jit_context_new_rvalue_from_long (comp.ctxt,
                                                 comp.lisp_word_type,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]