Commit e3dc222b authored by Tom Stellard's avatar Tom Stellard
Browse files

Merging r353865, r353866, and r353874:

------------------------------------------------------------------------
r353865 | sfertile | 2019-02-12 09:48:22 -0800 (Tue, 12 Feb 2019) | 1 line

[PowerPC] Fix printing of negative offsets in call instruction dissasembly.
------------------------------------------------------------------------

------------------------------------------------------------------------
r353866 | sfertile | 2019-02-12 09:49:04 -0800 (Tue, 12 Feb 2019) | 4 lines

[PPC64] Update tests to reflect change in printing of call operand. [NFC]

The printing of branch operands for call instructions was changed to properly
handle negative offsets. Updating the tests to reflect that.
------------------------------------------------------------------------

------------------------------------------------------------------------
r353874 | sfertile | 2019-02-12 12:03:04 -0800 (Tue, 12 Feb 2019) | 5 lines

Fix undefined behaviour in PPCInstPrinter::printBranchOperand.

Fix the undefined behaviour introduced by my previous patch r353865 (left
shifting a potentially negative value), which was caught by the bots that run
UBSan.
------------------------------------------------------------------------

llvm-svn: 362043
parent f0bd5981
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ caller:
# CHECK-LABEL: caller
# CHECK:         bl .+44
# CHECK-NEXT:    mr 31, 3
# CHECK-NEXT:    bl .+67108816
# CHECK-NEXT:    bl .-48
# CHECK-NEXT:    ld 2, 24(1)
# CHECK-NEXT:    add 3, 3, 31
# CHECK-NEXT:    addi 1, 1, 32
+2 −2
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ test:
# CHECK:  10010024: {{.*}}  b  .+33554428

# NEGOFFSET-LABEL: test
# NEGOFFSET:  10010014: {{.*}}  bl .+33554432
# NEGOFFSET:  10010014: {{.*}}  bl .-33554432
# NEGOFFSET:  10010024: {{.*}}  b  .+33554432

# .branch_lt[0]
@@ -83,7 +83,7 @@ test:
# the offset is interpreted as a signed 26 bit value so 67108812 is actually
# -52.
# THUNK-LABEL: test:
# THUNK: 10010034: {{.*}}  bl .+67108812
# THUNK: 10010034: {{.*}}  bl .-52
# THUNK: 10010044: {{.*}}  b .+67108812

# The offset from the TOC to the .branch_lt section  is (-1 << 16) - 32768.
+2 −2
Original line number Diff line number Diff line
@@ -42,9 +42,9 @@
# CHECK: _start:
# CHECK-NEXT:     addis 2, 12, 2
# CHECK-NEXT:     addi 2, 2, -32588
# CHECK-NEXT:     bl .+67108812
# CHECK-NEXT:     bl .-52
# CHECK-NEXT:     ld 2, 24(1)
# CHECK-NEXT:     bl .+67108824
# CHECK-NEXT:     bl .-40
# CHECK-NEXT:     ld 2, 24(1)

# Check tocbase
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ k:
// Dis:     test:
// Dis:        addis 3, 2, 0
// Dis-NEXT:   addi 3, 3, -32760
// Dis-NEXT:   bl .+67108804
// Dis-NEXT:   bl .-60
// Dis-NEXT:   ld 2, 24(1)
// Dis-NEXT:   addis 3, 3, 0
// Dis-NEXT:   lwa 3, -32768(3)
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@


// CHECK:            _start:
// CHECK:            bl .+67108824
// CHECK:            bl .-40
        .text
        .abiversion 2
        .globl  _start
Loading