guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 09/09: Fix shuffling assembler for new primcalls


From: Andy Wingo
Subject: [Guile-commits] 09/09: Fix shuffling assembler for new primcalls
Date: Mon, 11 May 2020 09:08:29 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit 2ba3eb4cf2295b4d5087d1ff58392c2a17d8451e
Author: Andy Wingo <address@hidden>
AuthorDate: Mon May 11 15:03:19 2020 +0200

    Fix shuffling assembler for new primcalls
    
    * module/system/vm/assembler.scm (encode-X8_S8_C8_S8-C32!/shuffle): New
      shuffling assembler.
---
 module/system/vm/assembler.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm
index 7849e55..774a2aa 100644
--- a/module/system/vm/assembler.scm
+++ b/module/system/vm/assembler.scm
@@ -975,6 +975,15 @@ later by the linker."
     (emit-push asm (+ c 2))
     (encode-X8_S8_S8_S8-C32 asm 2 1 0 c32 opcode)
     (emit-drop asm 3))))
+(define (encode-X8_S8_C8_S8-C32!/shuffle asm a const b c32 opcode)
+  (cond
+   ((< (logior a b) (ash 1 8))
+    (encode-X8_S8_C8_S8-C32 asm a const b c32 opcode))
+   (else
+    (emit-push asm a)
+    (emit-push asm (+ b 1))
+    (encode-X8_S8_C8_S8-C32 asm 1 const 0 c32 opcode)
+    (emit-drop asm 2))))
 (define (encode-X8_S12_S12-C32<-/shuffle asm dst src c32 opcode)
   (cond
    ((< (logior dst src) (ash 1 12))
@@ -1011,9 +1020,9 @@ later by the linker."
       (('<- 'X8_S8_S8_S8)        #'encode-X8_S8_S8_S8<-/shuffle)
       (('<- 'X8_S8_S8_C8)        #'encode-X8_S8_S8_C8<-/shuffle)
       (('! 'X8_S8_S8_S8 'C32)    #'encode-X8_S8_S8_S8-C32!/shuffle)
+      (('! 'X8_S8_C8_S8 'C32)    #'encode-X8_S8_C8_S8-C32!/shuffle)
       (('<- 'X8_S8_S8_S8 'C32)   #'encode-X8_S8_S8_S8-C32<-/shuffle)
       (('<- 'X8_S8_S8_C8 'C32)   #'encode-X8_S8_S8_C8-C32<-/shuffle)
-      (('! 'X8_S8_S8_C8 'C32)    #'encode-X8_S8_S8_C8-C32!/shuffle)
       (('<- 'X8_S12_S12 'C32)    #'encode-X8_S12_S12-C32<-/shuffle)
       (('! 'X8_S12_S12 'C32)     #'encode-X8_S12_S12-C32!/shuffle)
       (('! 'X8_S8_C8_S8)         #'encode-X8_S8_C8_S8!/shuffle)



reply via email to

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