aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/builtins/arm/switch8.S
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /contrib/libs/cxxsupp/builtins/arm/switch8.S
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/cxxsupp/builtins/arm/switch8.S')
-rw-r--r--contrib/libs/cxxsupp/builtins/arm/switch8.S84
1 files changed, 42 insertions, 42 deletions
diff --git a/contrib/libs/cxxsupp/builtins/arm/switch8.S b/contrib/libs/cxxsupp/builtins/arm/switch8.S
index d7c20423de..d33e545c73 100644
--- a/contrib/libs/cxxsupp/builtins/arm/switch8.S
+++ b/contrib/libs/cxxsupp/builtins/arm/switch8.S
@@ -1,42 +1,42 @@
-//===-- switch.S - Implement switch* --------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "../assembly.h"
-
-//
-// When compiling switch statements in thumb mode, the compiler
-// can use these __switch* helper functions The compiler emits a blx to
-// the __switch* function followed by a table of displacements for each
-// case statement. On entry, R0 is the index into the table. The __switch*
-// function uses the return address in lr to find the start of the table.
-// The first entry in the table is the count of the entries in the table.
-// It then uses R0 to index into the table and get the displacement of the
-// address to jump to. If R0 is greater than the size of the table, it jumps
-// to the last entry in the table. Each displacement in the table is actually
-// the distance from lr to the label, thus making the tables PIC.
-
-
- .text
- .syntax unified
-
-//
-// The table contains signed byte sized elements which are 1/2 the distance
-// from lr to the target label.
-//
- .p2align 2
-DEFINE_COMPILERRT_PRIVATE_FUNCTION(__switch8)
- ldrb ip, [lr, #-1] // get first byte in table
- cmp r0, ip // signed compare with index
- ite lo
- ldrsblo r0, [lr, r0] // get indexed byte out of table
- ldrsbhs r0, [lr, ip] // if out of range, use last entry in table
- add ip, lr, r0, lsl #1 // compute label = lr + element*2
- bx ip // jump to computed label
-END_COMPILERRT_FUNCTION(__switch8)
-
+//===-- switch.S - Implement switch* --------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "../assembly.h"
+
+//
+// When compiling switch statements in thumb mode, the compiler
+// can use these __switch* helper functions The compiler emits a blx to
+// the __switch* function followed by a table of displacements for each
+// case statement. On entry, R0 is the index into the table. The __switch*
+// function uses the return address in lr to find the start of the table.
+// The first entry in the table is the count of the entries in the table.
+// It then uses R0 to index into the table and get the displacement of the
+// address to jump to. If R0 is greater than the size of the table, it jumps
+// to the last entry in the table. Each displacement in the table is actually
+// the distance from lr to the label, thus making the tables PIC.
+
+
+ .text
+ .syntax unified
+
+//
+// The table contains signed byte sized elements which are 1/2 the distance
+// from lr to the target label.
+//
+ .p2align 2
+DEFINE_COMPILERRT_PRIVATE_FUNCTION(__switch8)
+ ldrb ip, [lr, #-1] // get first byte in table
+ cmp r0, ip // signed compare with index
+ ite lo
+ ldrsblo r0, [lr, r0] // get indexed byte out of table
+ ldrsbhs r0, [lr, ip] // if out of range, use last entry in table
+ add ip, lr, r0, lsl #1 // compute label = lr + element*2
+ bx ip // jump to computed label
+END_COMPILERRT_FUNCTION(__switch8)
+