[haiku-commits] haiku: hrev53007 - src/system/libroot/os/arch/m68k build/jam/repositories/HaikuPorts src/system/libroot/os/arch/ppc src/system/libroot/os/arch/sparc src/system/libroot/os/arch/x86_64

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 26 Mar 2019 16:41:50 -0400 (EDT)

hrev53007 adds 3 changesets to branch 'master'
old head: 4b2da9c371d02367607d33358d88ac5996fb5ea0
new head: 1e4172254d35c2c7573f24693b550016a04d9da9
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=1e4172254d35+%5E4b2da9c371d0

----------------------------------------------------------------------------

c3ba570c0898: remove unused byteswap functions.
  
  We need these only for gcc2, which doesn't have builtins.
  Only swapping floats and doubles remains to implement for all
  architectures.
  
  Change-Id: I60e39ad42d4ef762f3324f934f2996dde1412f1a
  Reviewed-on: https://review.haiku-os.org/c/1182
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

464b2027034d: sparc: add float/double swapping functions.
  
  Change-Id: I07590af796d689b5e97c03a97727edfd58f5a811
  Reviewed-on: https://review.haiku-os.org/c/1183
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

1e4172254d35: sparc: fill in HaikuPorts file.
  
  Change-Id: I7aef31e72a826936c45e3644a72eb0598386f1ae
  Reviewed-on: https://review.haiku-os.org/c/1309
  Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>

                                   [ PulkoMandy <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

6 files changed, 163 insertions(+), 119 deletions(-)
build/jam/repositories/HaikuPorts/sparc       | 103 ++++++++++++++++++++++
src/system/libroot/os/arch/m68k/byteorder.S   |  83 ++++++-----------
src/system/libroot/os/arch/ppc/byteorder.S    |  40 ---------
src/system/libroot/os/arch/sparc/Jamfile      |   2 +
src/system/libroot/os/arch/sparc/byteorder.S  |  32 +++++++
src/system/libroot/os/arch/x86_64/byteorder.S |  22 -----

############################################################################

Commit:      c3ba570c0898c4375895fa937a1de0dec178f267
URL:         https://git.haiku-os.org/haiku/commit/?id=c3ba570c0898
Author:      PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Sat Mar  9 14:55:14 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Tue Mar 26 20:41:46 2019 UTC

remove unused byteswap functions.

We need these only for gcc2, which doesn't have builtins.
Only swapping floats and doubles remains to implement for all
architectures.

Change-Id: I60e39ad42d4ef762f3324f934f2996dde1412f1a
Reviewed-on: https://review.haiku-os.org/c/1182
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/system/libroot/os/arch/m68k/byteorder.S 
b/src/system/libroot/os/arch/m68k/byteorder.S
index 330494a3c2..5c04129ffb 100644
--- a/src/system/libroot/os/arch/m68k/byteorder.S
+++ b/src/system/libroot/os/arch/m68k/byteorder.S
@@ -7,73 +7,42 @@
 
 .text
 
-/* uint16 __swap_int16(uint16 value)
- */
-FUNCTION(__swap_int16):
-               moveq.l #0,%d0
-               /* 32-bit aligned stack! */
-               move.l  (4,%a7),%d1
-               move.b  %d1,%d0
-               lsr.w   #8,%d1
-               lsl.w   #8,%d0
-               move.b  %d1,%d0
-               rts
-FUNCTION_END(__swap_int16)
-
-/* uint32 __swap_int32(uint32 value)
- */
-FUNCTION(__swap_int32):
-/*             moveq.l #0,%d0*/
-               move.b  (7,%a7),%d0
-               lsl.l   #8,%d0
-               move.b  (6,%a7),%d0
-               lsl.l   #8,%d0
-               move.b  (5,%a7),%d0
-               lsl.l   #8,%d0
-               move.b  (4,%a7),%d0
-               rts
-FUNCTION_END(__swap_int32)
-
-/* uint64 __swap_int64(uint64 value)
- */
-FUNCTION(__swap_int64):
-/*             moveq.l #0,%d0*/
-               move.b  (7,%a7),%d1
-               lsl.l   #8,%d1
-               move.b  (6,%a7),%d1
-               lsl.l   #8,%d1
-               move.b  (5,%a7),%d1
-               lsl.l   #8,%d1
-               move.b  (4,%a7),%d1
-               /**/
-               move.b  (11,%a7),%d0
-               lsl.l   #8,%d0
-               move.b  (10,%a7),%d0
-               lsl.l   #8,%d0
-               move.b  (9,%a7),%d0
-               lsl.l   #8,%d0
-               move.b  (8,%a7),%d0
-               rts
-FUNCTION_END(__swap_int64)
-
-/* TODO: The following functions can surely be optimized. A simple optimization
- * would be to define macros with the contents of the __swap_int{32,64}
- * functions and use those instead of calling the functions.
- */
 
 /* float __swap_float(float value)
  */
 FUNCTION(__swap_float):
-               jmp             __swap_int32
-               //rts
+/*             moveq.l #0,%d0*/
+               move.b  (7,%a7),%d0
+               lsl.l   #8,%d0
+               move.b  (6,%a7),%d0
+               lsl.l   #8,%d0
+               move.b  (5,%a7),%d0
+               lsl.l   #8,%d0
+               move.b  (4,%a7),%d0
+       rts
 FUNCTION_END(__swap_float)
 
 
 /* double __swap_double(double value)
  */
 FUNCTION(__swap_double):
-               jmp             __swap_int32
-               //rts
+/*             moveq.l #0,%d0*/
+               move.b  (7,%a7),%d1
+               lsl.l   #8,%d1
+               move.b  (6,%a7),%d1
+               lsl.l   #8,%d1
+               move.b  (5,%a7),%d1
+               lsl.l   #8,%d1
+               move.b  (4,%a7),%d1
+               /**/
+               move.b  (11,%a7),%d0
+               lsl.l   #8,%d0
+               move.b  (10,%a7),%d0
+               lsl.l   #8,%d0
+               move.b  (9,%a7),%d0
+               lsl.l   #8,%d0
+               move.b  (8,%a7),%d0
+               rts
 #warning M68K: XXX:check sizeof(double)
 FUNCTION_END(__swap_double)
 
diff --git a/src/system/libroot/os/arch/ppc/byteorder.S 
b/src/system/libroot/os/arch/ppc/byteorder.S
index 8f1b1536b8..c8a6d8824d 100644
--- a/src/system/libroot/os/arch/ppc/byteorder.S
+++ b/src/system/libroot/os/arch/ppc/byteorder.S
@@ -7,46 +7,6 @@
 
 .text
 
-/* uint16 __swap_int16(uint16 value)
- *                     r3
- */
-FUNCTION(__swap_int16):
-               rlwinm  %r4, %r3, 8, 16, 23             // byte 4 -> byte 3 
(clear other bits)
-               rlwimi  %r4, %r3, 24, 24, 31    // byte 3 -> byte 4 (copy into)
-               mr              %r3, %r4                                // copy 
to result register
-               blr
-
-
-/* uint32 __swap_int32(uint32 value)
- *                     r3
- */
-FUNCTION(__swap_int32):
-               rlwinm  %r4, %r3, 24, 0, 31             // byte 4 to 1, byte 2 
to 3
-               rlwimi  %r4, %r3, 8, 8, 15              // byte 3 to 2
-               rlwimi  %r4, %r3, 8, 24, 31             // byte 1 to 4
-               mr              %r3, %r4
-               blr
-
-
-/* uint64 __swap_int64(uint64 value)
- *                     r3/r4
- */
-FUNCTION(__swap_int64):
-               rlwinm  %r5, %r3, 24, 0, 31             // byte 4 to 5, byte 2 
to 7
-               rlwimi  %r5, %r3, 8, 8, 15              // byte 3 to 6
-               rlwimi  %r5, %r3, 8, 24, 31             // byte 1 to 8
-               rlwinm  %r3, %r4, 24, 0, 31             // byte 8 to 1, byte 6 
to 3
-               rlwimi  %r3, %r4, 8, 8, 15              // byte 7 to 2
-               rlwimi  %r3, %r4, 8, 24, 31             // byte 5 to 4
-               mr              %r4, %r5                                // copy 
lower 32 bits
-               blr
-
-
-/* TODO: The following functions can surely be optimized. A simple optimization
- * would be to define macros with the contents of the __swap_int{32,64}
- * functions and use those instead of calling the functions.
- */
-
 /* float __swap_float(float value)
  *                                       f1
  */
diff --git a/src/system/libroot/os/arch/x86_64/byteorder.S 
b/src/system/libroot/os/arch/x86_64/byteorder.S
index 9b346809fa..27066a6adf 100644
--- a/src/system/libroot/os/arch/x86_64/byteorder.S
+++ b/src/system/libroot/os/arch/x86_64/byteorder.S
@@ -7,28 +7,6 @@
 #include <asm_defs.h>
 
 
-/* uint16 __swap_int16(uint16 value) */
-FUNCTION(__swap_int16):
-       movl    %edi, %eax
-       bswap   %eax
-       shr             $16, %eax
-       ret
-FUNCTION_END(__swap_int16)
-
-/* uint32 __swap_int32(uint32 value) */
-FUNCTION(__swap_int32):
-       movl    %edi, %eax
-       bswap   %eax
-       ret
-FUNCTION_END(__swap_int32)
-
-/* uint64 __swap_int64(uint64 value) */
-FUNCTION(__swap_int64):
-       movq    %rdi, %rax
-       bswap   %rax
-       ret
-FUNCTION_END(__swap_int64)
-
 /* float __swap_float(float value) */
 FUNCTION(__swap_float):
        sub             $8, %rsp

############################################################################

Commit:      464b2027034d8e4acf445540a4cb041ac8c616dc
URL:         https://git.haiku-os.org/haiku/commit/?id=464b2027034d
Author:      PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Sat Mar  9 16:42:22 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Tue Mar 26 20:41:46 2019 UTC

sparc: add float/double swapping functions.

Change-Id: I07590af796d689b5e97c03a97727edfd58f5a811
Reviewed-on: https://review.haiku-os.org/c/1183
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/system/libroot/os/arch/sparc/Jamfile 
b/src/system/libroot/os/arch/sparc/Jamfile
index 725be98c7d..43d9ed6aff 100644
--- a/src/system/libroot/os/arch/sparc/Jamfile
+++ b/src/system/libroot/os/arch/sparc/Jamfile
@@ -13,6 +13,8 @@ for architectureObject in [ MultiArchSubDirSetup sparc ] {
                SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ;
 
                MergeObject <$(architecture)>os_arch_$(TARGET_ARCH).o :
+                       byteorder.S
+
                        stack_frame.c
                        system_time.c
                        thread.c
diff --git a/src/system/libroot/os/arch/sparc/byteorder.S 
b/src/system/libroot/os/arch/sparc/byteorder.S
new file mode 100644
index 0000000000..c7aa4616df
--- /dev/null
+++ b/src/system/libroot/os/arch/sparc/byteorder.S
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2019, Adrien Destugues, pulkomandy@xxxxxxxxxxxxx
+ * Distributed under the terms of the MIT License.
+ */
+
+#include <asm_defs.h>
+
+.text
+
+// These function use the unused parameters slots on the stack (reserved for
+// arguments that are in fact passed in registers) for temporary storage.
+// %o0 is corrupt, but it is a scratch register so this should be fine.
+
+/* float __swap_float(float value)
+ */
+FUNCTION(__swap_float):
+       add %sp, 2175, %o0
+       st %d0, [%o0]
+       lda [%o0] 0x88, %d0
+       return
+FUNCTION_END(__swap_float)
+
+
+/* double __swap_double(double value)
+ */
+FUNCTION(__swap_double):
+       add %sp, 2175, %o0
+       std %d0, [%o0]
+       ldda [%o0] 0x88, %d0
+       return
+FUNCTION_END(__swap_double)
+

############################################################################

Revision:    hrev53007
Commit:      1e4172254d35c2c7573f24693b550016a04d9da9
URL:         https://git.haiku-os.org/haiku/commit/?id=1e4172254d35
Author:      PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Fri Mar 22 18:37:00 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Tue Mar 26 20:41:46 2019 UTC

sparc: fill in HaikuPorts file.

Change-Id: I7aef31e72a826936c45e3644a72eb0598386f1ae
Reviewed-on: https://review.haiku-os.org/c/1309
Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/build/jam/repositories/HaikuPorts/sparc 
b/build/jam/repositories/HaikuPorts/sparc
index e69de29bb2..352f5b4335 100644
--- a/build/jam/repositories/HaikuPorts/sparc
+++ b/build/jam/repositories/HaikuPorts/sparc
@@ -0,0 +1,103 @@
+RemotePackageRepository HaikuPorts
+       : sparc
+       : https://eu.hpkg.haiku-os.org/haikuports/master/build-packages
+       :
+       # architecture "any" packages
+       be_book-2008_10_26-2
+       ca_root_certificates-2018_01_17-2
+       gnu_efi_kernel-3.0.8-1
+       timgmsoundfont-fixed-5
+       wqy_microhei-0.2.0~beta-4
+       :
+       # repository architecture packages
+       # primary architecture (arm)
+       curl-7.26.0-1
+       curl_devel-7.26.0-1
+       freetype-2.4.9-1
+       freetype_devel-2.4.9-1
+       gawk-3.1.8-2
+       gcc_syslibs_devel-4.8.3_2014_08_03-1
+       gcc_syslibs-4.8.3_2014_08_03-1
+       icu-4.8.1.1-1
+       icu_devel-4.8.1.1-1
+       libsolv-0.3.0_haiku_2013_10_01-1
+       libsolv_devel-0.3.0_haiku_2013_10_01-1
+       zlib-1.2.8-4
+       zlib_devel-1.2.8-4
+       :
+       # source packages
+       apr
+       autoconf
+       automake
+#      bepdf
+       binutils
+       bison
+       bzip2
+       cdrtools
+       cmake
+       ctags
+       curl
+       cvs
+       doxygen
+       expat
+#      ffmpeg
+       flex
+       freetype
+       gcc
+       gettext
+       git
+       glu
+       gperf
+       grep
+       groff
+       haikuwebkit
+       htmldoc
+       icu
+       jam
+       jpeg
+       keymapswitcher
+       libedit
+       libiconv
+#      libogg
+       libpcre
+       libpng
+       libsolv
+#      libtheora
+       libtool
+#      libvorbis
+#      libvpx
+       libxml2
+       m4
+       make
+       man
+       mercurial
+       mesa
+       mkdepend
+       nano
+       ncurses
+       neon
+       openssh
+       openssl
+       p7zip
+       pe
+       perl
+       pkgconfig
+       python
+       readline
+       scons
+       sed
+#      speex
+       sqlite
+       subversion
+       tar
+       texi2html
+       texinfo
+       vision
+       wpa_supplicant
+       yasm
+       xz_utils
+       zlib
+       :
+       # debuginfo packages
+       ;
+


Other related posts:

  • » [haiku-commits] haiku: hrev53007 - src/system/libroot/os/arch/m68k build/jam/repositories/HaikuPorts src/system/libroot/os/arch/ppc src/system/libroot/os/arch/sparc src/system/libroot/os/arch/x86_64 - waddlesplash