Author: ed
Date: Mon Sep 19 17:31:05 2016
New Revision: 305987
URL: https://svnweb.freebsd.org/changeset/base/305987

Log:
  Sync in latest vDSOs from upstream.
  
  - Use conditional instruction to simplify the ARMv6 vDSO. This means
    that we no longer perform any branching. In the failure case, we
    simply slide over the assignments of the return values.
  
    The vDSO could be improved even further by using stmia to do
    assignments in parallel. Unfortunately, the script used to generate
    these is not smart enough for that (yet).
  
    Spotted by: andrew@.
  
  - Make the style of the i686 vDSO more similar to the others by using
    decimal literals.

Modified:
  head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S
  head/sys/contrib/cloudabi/cloudabi_vdso_i686.S

Modified: head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S
==============================================================================
--- head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S     Mon Sep 19 17:17:29 
2016        (r305986)
+++ head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S     Mon Sep 19 17:31:05 
2016        (r305987)
@@ -38,24 +38,20 @@ ENTRY(cloudabi_sys_clock_res_get)
   str r1, [sp, #-4]
   mov ip, #0
   swi 0
-  ldr r2, [sp, #-4]
-  bcs 1f
-  str r0, [r2, 0]
-  str r1, [r2, 4]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #-4]
+  strcc r0, [r2, 0]
+  strcc r1, [r2, 4]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_clock_res_get)
 
 ENTRY(cloudabi_sys_clock_time_get)
   mov ip, #1
   swi 0
-  bcs 1f
-  ldr r2, [sp, #0]
-  str r0, [r2, 0]
-  str r1, [r2, 4]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #0]
+  strcc r0, [r2, 0]
+  strcc r1, [r2, 4]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_clock_time_get)
 
@@ -75,11 +71,9 @@ ENTRY(cloudabi_sys_fd_create1)
   str r1, [sp, #-4]
   mov ip, #4
   swi 0
-  ldr r2, [sp, #-4]
-  bcs 1f
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #-4]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_fd_create1)
 
@@ -88,13 +82,11 @@ ENTRY(cloudabi_sys_fd_create2)
   str r2, [sp, #-8]
   mov ip, #5
   swi 0
-  ldr r2, [sp, #-4]
-  ldr r3, [sp, #-8]
-  bcs 1f
-  str r0, [r2]
-  str r1, [r3]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #-4]
+  ldrcc r3, [sp, #-8]
+  strcc r0, [r2]
+  strcc r1, [r3]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_fd_create2)
 
@@ -108,33 +100,27 @@ ENTRY(cloudabi_sys_fd_dup)
   str r1, [sp, #-4]
   mov ip, #7
   swi 0
-  ldr r2, [sp, #-4]
-  bcs 1f
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #-4]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_fd_dup)
 
 ENTRY(cloudabi_sys_fd_pread)
   mov ip, #8
   swi 0
-  bcs 1f
-  ldr r2, [sp, #8]
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #8]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_fd_pread)
 
 ENTRY(cloudabi_sys_fd_pwrite)
   mov ip, #9
   swi 0
-  bcs 1f
-  ldr r2, [sp, #8]
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #8]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_fd_pwrite)
 
@@ -142,11 +128,9 @@ ENTRY(cloudabi_sys_fd_read)
   str r3, [sp, #-4]
   mov ip, #10
   swi 0
-  ldr r2, [sp, #-4]
-  bcs 1f
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #-4]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_fd_read)
 
@@ -159,12 +143,10 @@ END(cloudabi_sys_fd_replace)
 ENTRY(cloudabi_sys_fd_seek)
   mov ip, #12
   swi 0
-  bcs 1f
-  ldr r2, [sp, #4]
-  str r0, [r2, 0]
-  str r1, [r2, 4]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #4]
+  strcc r0, [r2, 0]
+  strcc r1, [r2, 4]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_fd_seek)
 
@@ -190,11 +172,9 @@ ENTRY(cloudabi_sys_fd_write)
   str r3, [sp, #-4]
   mov ip, #16
   swi 0
-  ldr r2, [sp, #-4]
-  bcs 1f
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #-4]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_fd_write)
 
@@ -225,33 +205,27 @@ END(cloudabi_sys_file_link)
 ENTRY(cloudabi_sys_file_open)
   mov ip, #21
   swi 0
-  bcs 1f
-  ldr r2, [sp, #8]
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #8]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_file_open)
 
 ENTRY(cloudabi_sys_file_readdir)
   mov ip, #22
   swi 0
-  bcs 1f
-  ldr r2, [sp, #8]
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #8]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_file_readdir)
 
 ENTRY(cloudabi_sys_file_readlink)
   mov ip, #23
   swi 0
-  bcs 1f
-  ldr r2, [sp, #4]
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #4]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_file_readlink)
 
@@ -318,11 +292,9 @@ END(cloudabi_sys_mem_lock)
 ENTRY(cloudabi_sys_mem_map)
   mov ip, #34
   swi 0
-  bcs 1f
-  ldr r2, [sp, #16]
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #16]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_mem_map)
 
@@ -354,22 +326,18 @@ ENTRY(cloudabi_sys_poll)
   str r3, [sp, #-4]
   mov ip, #39
   swi 0
-  ldr r2, [sp, #-4]
-  bcs 1f
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #-4]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_poll)
 
 ENTRY(cloudabi_sys_poll_fd)
   mov ip, #40
   swi 0
-  bcs 1f
-  ldr r2, [sp, #8]
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #8]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_poll_fd)
 
@@ -389,13 +357,11 @@ ENTRY(cloudabi_sys_proc_fork)
   str r1, [sp, #-8]
   mov ip, #43
   swi 0
-  ldr r2, [sp, #-4]
-  ldr r3, [sp, #-8]
-  bcs 1f
-  str r0, [r2]
-  str r1, [r3]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #-4]
+  ldrcc r3, [sp, #-8]
+  strcc r0, [r2]
+  strcc r1, [r3]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_proc_fork)
 
@@ -415,11 +381,9 @@ ENTRY(cloudabi_sys_sock_accept)
   str r2, [sp, #-4]
   mov ip, #46
   swi 0
-  ldr r2, [sp, #-4]
-  bcs 1f
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #-4]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_sock_accept)
 
@@ -469,11 +433,9 @@ ENTRY(cloudabi_sys_thread_create)
   str r1, [sp, #-4]
   mov ip, #54
   swi 0
-  ldr r2, [sp, #-4]
-  bcs 1f
-  str r0, [r2]
-  mov r0, $0
-1:
+  ldrcc r2, [sp, #-4]
+  strcc r0, [r2]
+  movcc r0, $0
   bx lr
 END(cloudabi_sys_thread_create)
 

Modified: head/sys/contrib/cloudabi/cloudabi_vdso_i686.S
==============================================================================
--- head/sys/contrib/cloudabi/cloudabi_vdso_i686.S      Mon Sep 19 17:17:29 
2016        (r305986)
+++ head/sys/contrib/cloudabi/cloudabi_vdso_i686.S      Mon Sep 19 17:31:05 
2016        (r305987)
@@ -30,7 +30,7 @@
   .p2align 2, 0x90;      \
   .global name;          \
   .type name, @function; \
-  name:
+name:
 
 #define END(name) .size name, . - name
 
@@ -38,7 +38,7 @@ ENTRY(cloudabi_sys_clock_res_get)
   mov $0, %eax
   int $0x80
   jc 1f
-  mov 0x8(%esp), %ecx
+  mov 8(%esp), %ecx
   mov %eax, 0(%ecx)
   mov %edx, 4(%ecx)
   xor %eax, %eax
@@ -50,7 +50,7 @@ ENTRY(cloudabi_sys_clock_time_get)
   mov $1, %eax
   int $0x80
   jc 1f
-  mov 0x10(%esp), %ecx
+  mov 16(%esp), %ecx
   mov %eax, 0(%ecx)
   mov %edx, 4(%ecx)
   xor %eax, %eax
@@ -74,7 +74,7 @@ ENTRY(cloudabi_sys_fd_create1)
   mov $4, %eax
   int $0x80
   jc 1f
-  mov 0x8(%esp), %ecx
+  mov 8(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
@@ -85,9 +85,9 @@ ENTRY(cloudabi_sys_fd_create2)
   mov $5, %eax
   int $0x80
   jc 1f
-  mov 0x8(%esp), %ecx
+  mov 8(%esp), %ecx
   mov %eax, (%ecx)
-  mov 0xc(%esp), %ecx
+  mov 12(%esp), %ecx
   mov %edx, (%ecx)
   xor %eax, %eax
 1:
@@ -104,7 +104,7 @@ ENTRY(cloudabi_sys_fd_dup)
   mov $7, %eax
   int $0x80
   jc 1f
-  mov 0x8(%esp), %ecx
+  mov 8(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
@@ -115,7 +115,7 @@ ENTRY(cloudabi_sys_fd_pread)
   mov $8, %eax
   int $0x80
   jc 1f
-  mov 0x18(%esp), %ecx
+  mov 24(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
@@ -126,7 +126,7 @@ ENTRY(cloudabi_sys_fd_pwrite)
   mov $9, %eax
   int $0x80
   jc 1f
-  mov 0x18(%esp), %ecx
+  mov 24(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
@@ -137,7 +137,7 @@ ENTRY(cloudabi_sys_fd_read)
   mov $10, %eax
   int $0x80
   jc 1f
-  mov 0x10(%esp), %ecx
+  mov 16(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
@@ -154,7 +154,7 @@ ENTRY(cloudabi_sys_fd_seek)
   mov $12, %eax
   int $0x80
   jc 1f
-  mov 0x14(%esp), %ecx
+  mov 20(%esp), %ecx
   mov %eax, 0(%ecx)
   mov %edx, 4(%ecx)
   xor %eax, %eax
@@ -184,7 +184,7 @@ ENTRY(cloudabi_sys_fd_write)
   mov $16, %eax
   int $0x80
   jc 1f
-  mov 0x10(%esp), %ecx
+  mov 16(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
@@ -219,7 +219,7 @@ ENTRY(cloudabi_sys_file_open)
   mov $21, %eax
   int $0x80
   jc 1f
-  mov 0x1c(%esp), %ecx
+  mov 28(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
@@ -230,7 +230,7 @@ ENTRY(cloudabi_sys_file_readdir)
   mov $22, %eax
   int $0x80
   jc 1f
-  mov 0x18(%esp), %ecx
+  mov 24(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
@@ -241,7 +241,7 @@ ENTRY(cloudabi_sys_file_readlink)
   mov $23, %eax
   int $0x80
   jc 1f
-  mov 0x18(%esp), %ecx
+  mov 24(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
@@ -312,7 +312,7 @@ ENTRY(cloudabi_sys_mem_map)
   mov $34, %eax
   int $0x80
   jc 1f
-  mov 0x20(%esp), %ecx
+  mov 32(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
@@ -347,7 +347,7 @@ ENTRY(cloudabi_sys_poll)
   mov $39, %eax
   int $0x80
   jc 1f
-  mov 0x10(%esp), %ecx
+  mov 16(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
@@ -358,7 +358,7 @@ ENTRY(cloudabi_sys_poll_fd)
   mov $40, %eax
   int $0x80
   jc 1f
-  mov 0x1c(%esp), %ecx
+  mov 28(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
@@ -380,9 +380,9 @@ ENTRY(cloudabi_sys_proc_fork)
   mov $43, %eax
   int $0x80
   jc 1f
-  mov 0x4(%esp), %ecx
+  mov 4(%esp), %ecx
   mov %eax, (%ecx)
-  mov 0x8(%esp), %ecx
+  mov 8(%esp), %ecx
   mov %edx, (%ecx)
   xor %eax, %eax
 1:
@@ -405,7 +405,7 @@ ENTRY(cloudabi_sys_sock_accept)
   mov $46, %eax
   int $0x80
   jc 1f
-  mov 0xc(%esp), %ecx
+  mov 12(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
@@ -458,7 +458,7 @@ ENTRY(cloudabi_sys_thread_create)
   mov $54, %eax
   int $0x80
   jc 1f
-  mov 0x8(%esp), %ecx
+  mov 8(%esp), %ecx
   mov %eax, (%ecx)
   xor %eax, %eax
 1:
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to