Merge pull request #1962 from cfallin/aarch64-lowering-condbr
AArch64: avoid branches with explicit offsets at lowering stage.
This commit is contained in:
@@ -76,12 +76,10 @@ block0(v0: i64, v1: i64):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: sdiv x2, x0, x1
|
||||
; nextln: cbz x1, 20
|
||||
; nextln: cbnz x1, 8 ; udf
|
||||
; nextln: adds xzr, x1, #1
|
||||
; nextln: ccmp x0, #1, #nzcv, eq
|
||||
; nextln: b.vc 12
|
||||
; nextln: udf
|
||||
; nextln: udf
|
||||
; nextln: b.vc 8 ; udf
|
||||
; nextln: mov x0, x2
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -98,12 +96,10 @@ block0(v0: i64):
|
||||
; nextln: mov fp, sp
|
||||
; nextln: movz x2, #2
|
||||
; nextln: sdiv x1, x0, x2
|
||||
; nextln: cbz x2, 20
|
||||
; nextln: cbnz x2, 8 ; udf
|
||||
; nextln: adds xzr, x2, #1
|
||||
; nextln: ccmp x0, #1, #nzcv, eq
|
||||
; nextln: b.vc 12
|
||||
; nextln: udf
|
||||
; nextln: udf
|
||||
; nextln: b.vc 8 ; udf
|
||||
; nextln: mov x0, x1
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -118,8 +114,7 @@ block0(v0: i64, v1: i64):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: udiv x0, x0, x1
|
||||
; nextln: cbnz x1, 8
|
||||
; nextln: udf
|
||||
; nextln: cbnz x1, 8 ; udf
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
; nextln: ret
|
||||
@@ -135,8 +130,7 @@ block0(v0: i64):
|
||||
; nextln: mov fp, sp
|
||||
; nextln: movz x1, #2
|
||||
; nextln: udiv x0, x0, x1
|
||||
; nextln: cbnz x1, 8
|
||||
; nextln: udf
|
||||
; nextln: cbnz x1, 8 ; udf
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
; nextln: ret
|
||||
@@ -150,8 +144,7 @@ block0(v0: i64, v1: i64):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: sdiv x2, x0, x1
|
||||
; nextln: cbnz x1, 8
|
||||
; nextln: udf
|
||||
; nextln: cbnz x1, 8 ; udf
|
||||
; nextln: msub x0, x2, x1, x0
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -166,8 +159,7 @@ block0(v0: i64, v1: i64):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: udiv x2, x0, x1
|
||||
; nextln: cbnz x1, 8
|
||||
; nextln: udf
|
||||
; nextln: cbnz x1, 8 ; udf
|
||||
; nextln: msub x0, x2, x1, x0
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -185,12 +177,10 @@ block0(v0: i32, v1: i32):
|
||||
; nextln: sxtw x3, w0
|
||||
; nextln: sxtw x2, w1
|
||||
; nextln: sdiv x0, x3, x2
|
||||
; nextln: cbz x2, 20
|
||||
; nextln: cbnz x2, 8 ; udf
|
||||
; nextln: adds wzr, w2, #1
|
||||
; nextln: ccmp w3, #1, #nzcv, eq
|
||||
; nextln: b.vc 12
|
||||
; nextln: udf
|
||||
; nextln: udf
|
||||
; nextln: b.vc 8 ; udf
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
; nextln: ret
|
||||
@@ -204,16 +194,15 @@ block0(v0: i32):
|
||||
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: sxtw x1, w0
|
||||
; nextln: movz x0, #2
|
||||
; nextln: sxtw x2, w0
|
||||
; nextln: sdiv x0, x1, x2
|
||||
; nextln: cbz x2, 20
|
||||
; nextln: sxtw x0, w0
|
||||
; nextln: movz x1, #2
|
||||
; nextln: sxtw x2, w1
|
||||
; nextln: sdiv x1, x0, x2
|
||||
; nextln: cbnz x2, 8 ; udf
|
||||
; nextln: adds wzr, w2, #1
|
||||
; nextln: ccmp w1, #1, #nzcv, eq
|
||||
; nextln: b.vc 12
|
||||
; nextln: udf
|
||||
; nextln: udf
|
||||
; nextln: ccmp w0, #1, #nzcv, eq
|
||||
; nextln: b.vc 8 ; udf
|
||||
; nextln: mov x0, x1
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
; nextln: ret
|
||||
@@ -229,8 +218,7 @@ block0(v0: i32, v1: i32):
|
||||
; nextln: mov w0, w0
|
||||
; nextln: mov w1, w1
|
||||
; nextln: udiv x0, x0, x1
|
||||
; nextln: cbnz x1, 8
|
||||
; nextln: udf
|
||||
; nextln: cbnz x1, 8 ; udf
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
; nextln: ret
|
||||
@@ -248,8 +236,7 @@ block0(v0: i32):
|
||||
; nextln: mov w0, w0
|
||||
; nextln: movz x1, #2
|
||||
; nextln: udiv x0, x0, x1
|
||||
; nextln: cbnz x1, 8
|
||||
; nextln: udf
|
||||
; nextln: cbnz x1, 8 ; udf
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
; nextln: ret
|
||||
@@ -265,8 +252,7 @@ block0(v0: i32, v1: i32):
|
||||
; nextln: sxtw x0, w0
|
||||
; nextln: sxtw x1, w1
|
||||
; nextln: sdiv x2, x0, x1
|
||||
; nextln: cbnz x1, 8
|
||||
; nextln: udf
|
||||
; nextln: cbnz x1, 8 ; udf
|
||||
; nextln: msub x0, x2, x1, x0
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -283,8 +269,7 @@ block0(v0: i32, v1: i32):
|
||||
; nextln: mov w0, w0
|
||||
; nextln: mov w1, w1
|
||||
; nextln: udiv x2, x0, x1
|
||||
; nextln: cbnz x1, 8
|
||||
; nextln: udf
|
||||
; nextln: cbnz x1, 8 ; udf
|
||||
; nextln: msub x0, x2, x1, x0
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
|
||||
@@ -426,16 +426,13 @@ block0(v0: f32):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: fcmp s0, s0
|
||||
; nextln: b.vc 8
|
||||
; nextln: udf
|
||||
; nextln: b.vc 8 ; udf
|
||||
; nextln: ldr s1, pc+8 ; b 8 ; data.f32 -1
|
||||
; nextln: fcmp s0, s1
|
||||
; nextln: b.gt 8
|
||||
; nextln: udf
|
||||
; nextln: b.gt 8 ; udf
|
||||
; nextln: ldr s1, pc+8 ; b 8 ; data.f32 4294967300
|
||||
; nextln: fcmp s0, s1
|
||||
; nextln: b.mi 8
|
||||
; nextln: udf
|
||||
; nextln: b.mi 8 ; udf
|
||||
; nextln: fcvtzu w0, s0
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -450,16 +447,13 @@ block0(v0: f32):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: fcmp s0, s0
|
||||
; nextln: b.vc 8
|
||||
; nextln: udf
|
||||
; nextln: b.vc 8 ; udf
|
||||
; nextln: ldr s1, pc+8 ; b 8 ; data.f32 -2147483600
|
||||
; nextln: fcmp s0, s1
|
||||
; nextln: b.ge 8
|
||||
; nextln: udf
|
||||
; nextln: b.ge 8 ; udf
|
||||
; nextln: ldr s1, pc+8 ; b 8 ; data.f32 2147483600
|
||||
; nextln: fcmp s0, s1
|
||||
; nextln: b.mi
|
||||
; nextln: udf
|
||||
; nextln: b.mi 8 ; udf
|
||||
; nextln: fcvtzs w0, s0
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -474,16 +468,13 @@ block0(v0: f32):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: fcmp s0, s0
|
||||
; nextln: b.vc 8
|
||||
; nextln: udf
|
||||
; nextln: b.vc 8 ; udf
|
||||
; nextln: ldr s1, pc+8 ; b 8 ; data.f32 -1
|
||||
; nextln: fcmp s0, s1
|
||||
; nextln: b.gt 8
|
||||
; nextln: udf
|
||||
; nextln: b.gt 8 ; udf
|
||||
; nextln: ldr s1, pc+8 ; b 8 ; data.f32 18446744000000000000
|
||||
; nextln: fcmp s0, s1
|
||||
; nextln: b.mi 8
|
||||
; nextln: udf
|
||||
; nextln: b.mi 8 ; udf
|
||||
; nextln: fcvtzu x0, s0
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -498,16 +489,13 @@ block0(v0: f32):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: fcmp s0, s0
|
||||
; nextln: b.vc 8
|
||||
; nextln: udf
|
||||
; nextln: b.vc 8 ; udf
|
||||
; nextln: ldr s1, pc+8 ; b 8 ; data.f32 -9223372000000000000
|
||||
; nextln: fcmp s0, s1
|
||||
; nextln: b.ge 8
|
||||
; nextln: udf
|
||||
; nextln: b.ge 8 ; udf
|
||||
; nextln: ldr s1, pc+8 ; b 8 ; data.f32 9223372000000000000
|
||||
; nextln: fcmp s0, s1
|
||||
; nextln: b.mi 8
|
||||
; nextln: udf
|
||||
; nextln: b.mi 8 ; udf
|
||||
; nextln: fcvtzs x0, s0
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -522,16 +510,13 @@ block0(v0: f64):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: fcmp d0, d0
|
||||
; nextln: b.vc 8
|
||||
; nextln: udf
|
||||
; nextln: b.vc 8 ; udf
|
||||
; nextln: ldr d1, pc+8 ; b 12 ; data.f64 -1
|
||||
; nextln: fcmp d0, d1
|
||||
; nextln: b.gt 8
|
||||
; nextln: udf
|
||||
; nextln: b.gt 8 ; udf
|
||||
; nextln: ldr d1, pc+8 ; b 12 ; data.f64 4294967296
|
||||
; nextln: fcmp d0, d1
|
||||
; nextln: b.mi 8
|
||||
; nextln: udf
|
||||
; nextln: b.mi 8 ; udf
|
||||
; nextln: fcvtzu w0, d0
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -546,16 +531,13 @@ block0(v0: f64):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: fcmp d0, d0
|
||||
; nextln: b.vc 8
|
||||
; nextln: udf
|
||||
; nextln: b.vc 8 ; udf
|
||||
; nextln: ldr d1, pc+8 ; b 12 ; data.f64 -2147483649
|
||||
; nextln: fcmp d0, d1
|
||||
; nextln: b.gt 8
|
||||
; nextln: udf
|
||||
; nextln: b.gt 8 ; udf
|
||||
; nextln: ldr d1, pc+8 ; b 12 ; data.f64 2147483648
|
||||
; nextln: fcmp d0, d1
|
||||
; nextln: b.mi 8
|
||||
; nextln: udf
|
||||
; nextln: b.mi 8 ; udf
|
||||
; nextln: fcvtzs w0, d0
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -570,16 +552,13 @@ block0(v0: f64):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: fcmp d0, d0
|
||||
; nextln: b.vc 8
|
||||
; nextln: udf
|
||||
; nextln: b.vc 8 ; udf
|
||||
; nextln: ldr d1, pc+8 ; b 12 ; data.f64 -1
|
||||
; nextln: fcmp d0, d1
|
||||
; nextln: b.gt 8
|
||||
; nextln: udf
|
||||
; nextln: b.gt 8 ; udf
|
||||
; nextln: ldr d1, pc+8 ; b 12 ; data.f64 18446744073709552000
|
||||
; nextln: fcmp d0, d1
|
||||
; nextln: b.mi 8
|
||||
; nextln: udf
|
||||
; nextln: b.mi 8 ; udf
|
||||
; nextln: fcvtzu x0, d0
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -594,16 +573,13 @@ block0(v0: f64):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: fcmp d0, d0
|
||||
; nextln: b.vc 8
|
||||
; nextln: udf
|
||||
; nextln: b.vc 8 ; udf
|
||||
; nextln: ldr d1, pc+8 ; b 12 ; data.f64 -9223372036854776000
|
||||
; nextln: fcmp d0, d1
|
||||
; nextln: b.ge 8
|
||||
; nextln: udf
|
||||
; nextln: b.ge 8 ; udf
|
||||
; nextln: ldr d1, pc+8 ; b 12 ; data.f64 9223372036854776000
|
||||
; nextln: fcmp d0, d1
|
||||
; nextln: b.mi 8
|
||||
; nextln: udf
|
||||
; nextln: b.mi 8 ; udf
|
||||
; nextln: fcvtzs x0, d0
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
|
||||
@@ -29,8 +29,7 @@ block5(v5: i64):
|
||||
}
|
||||
|
||||
; check: subs wzr, w0, #3
|
||||
; nextln: b.hs
|
||||
; nextln: adr x1, pc+16 ; ldrsw x2, [x1, x0, LSL 2] ; add x1, x1, x2 ; br x1 ; jt_entries
|
||||
; nextln: b.hs label1 ; adr x1, pc+16 ; ldrsw x2, [x1, x0, LSL 2] ; add x1, x1, x2 ; br x1 ; jt_entries
|
||||
|
||||
; check: movz x1, #1
|
||||
; nextln: b
|
||||
|
||||
@@ -43,8 +43,7 @@ block0(v0: i64):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: subs xzr, sp, x0
|
||||
; nextln: b.hs 8
|
||||
; nextln: udf
|
||||
; nextln: b.hs 8 ; udf
|
||||
; nextln: ldr x16
|
||||
; nextln: blr x16
|
||||
; nextln: mov sp, fp
|
||||
@@ -67,8 +66,7 @@ block0(v0: i64):
|
||||
; nextln: ldur x16, [x0]
|
||||
; nextln: ldur x16, [x16, #4]
|
||||
; nextln: subs xzr, sp, x16
|
||||
; nextln: b.hs 8
|
||||
; nextln: udf
|
||||
; nextln: b.hs 8 ; udf
|
||||
; nextln: ldr x16
|
||||
; nextln: blr x16
|
||||
; nextln: mov sp, fp
|
||||
@@ -86,8 +84,7 @@ block0(v0: i64):
|
||||
; nextln: mov fp, sp
|
||||
; nextln: add x16, x0, #176
|
||||
; nextln: subs xzr, sp, x16
|
||||
; nextln: b.hs 8
|
||||
; nextln: udf
|
||||
; nextln: b.hs 8 ; udf
|
||||
; nextln: sub sp, sp, #176
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -102,14 +99,12 @@ block0(v0: i64):
|
||||
; check: stp fp, lr, [sp, #-16]!
|
||||
; nextln: mov fp, sp
|
||||
; nextln: subs xzr, sp, x0
|
||||
; nextln: b.hs 8
|
||||
; nextln: udf
|
||||
; nextln: b.hs 8 ; udf
|
||||
; nextln: movz x17, #6784
|
||||
; nextln: movk x17, #6, LSL #16
|
||||
; nextln: add x16, x0, x17, UXTX
|
||||
; nextln: subs xzr, sp, x16
|
||||
; nextln: b.hs 8
|
||||
; nextln: udf
|
||||
; nextln: b.hs 8 ; udf
|
||||
; nextln: ldr x16, 8 ; b 12 ; data 400000
|
||||
; nextln: sub sp, sp, x16, UXTX
|
||||
; nextln: mov sp, fp
|
||||
@@ -132,8 +127,7 @@ block0(v0: i64):
|
||||
; nextln: ldur x16, [x16, #4]
|
||||
; nextln: add x16, x16, #32
|
||||
; nextln: subs xzr, sp, x16
|
||||
; nextln: b.hs 8
|
||||
; nextln: udf
|
||||
; nextln: b.hs 8 ; udf
|
||||
; nextln: sub sp, sp, #32
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
@@ -154,14 +148,12 @@ block0(v0: i64):
|
||||
; nextln: ldur x16, [x0]
|
||||
; nextln: ldur x16, [x16, #4]
|
||||
; nextln: subs xzr, sp, x16
|
||||
; nextln: b.hs 8
|
||||
; nextln: udf
|
||||
; nextln: b.hs 8 ; udf
|
||||
; nextln: movz x17, #6784
|
||||
; nextln: movk x17, #6, LSL #16
|
||||
; nextln: add x16, x16, x17, UXTX
|
||||
; nextln: subs xzr, sp, x16
|
||||
; nextln: b.hs 8
|
||||
; nextln: udf
|
||||
; nextln: b.hs 8 ; udf
|
||||
; nextln: ldr x16, 8 ; b 12 ; data 400000
|
||||
; nextln: sub sp, sp, x16, UXTX
|
||||
; nextln: mov sp, fp
|
||||
@@ -182,8 +174,7 @@ block0(v0: i64):
|
||||
; nextln: movz x16, #6784 ; movk x16, #6, LSL #16 ; add x16, x0, x16, UXTX ; ldr x16, [x16]
|
||||
; nextln: add x16, x16, #32
|
||||
; nextln: subs xzr, sp, x16
|
||||
; nextln: b.hs 8
|
||||
; nextln: udf
|
||||
; nextln: b.hs 8 ; udf
|
||||
; nextln: sub sp, sp, #32
|
||||
; nextln: mov sp, fp
|
||||
; nextln: ldp fp, lr, [sp], #16
|
||||
|
||||
@@ -17,8 +17,7 @@ block0(v0: i64):
|
||||
}
|
||||
|
||||
; check: subs xzr, x0, #42
|
||||
; nextln: b.ne 8
|
||||
; nextln: udf
|
||||
; nextln: b.ne 8 ; udf
|
||||
|
||||
function %h() {
|
||||
block0:
|
||||
|
||||
Reference in New Issue
Block a user