# NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --version 6 # RUN: llvm-mc -triple powerpc64-unknown-unknown --show-encoding \ # RUN: -mattr=+isa-future-instructions,+prefix-instrs %s | \ # RUN: FileCheck -check-prefix=CHECK-BE %s # RUN: llvm-mc -triple powerpc64le-unknown-unknown --show-encoding \ # RUN: -mattr=+isa-future-instructions,+prefix-instrs %s | \ # RUN: FileCheck -check-prefix=CHECK-LE %s # psubis RT, RA, SI is an alias for paddis RT, RA, -SI, 0. # psubis 3, 3, 1 -> paddis 3, 3, -1, 0 # -1 = 0xFFFFFFFF: prefix SI[31:16]=0xFFFF, instr SI[15:0]=0xFFFF # Prefix (BE): 06 00 FF FF # Instr (BE): 3C 63 FF FF psubis 3, 3, 1 # CHECK-BE: paddis 3, 3, -1, 0 # encoding: [0x06,0x00,0xff,0xff,0x3c,0x63,0xff,0xff] # CHECK-LE: paddis 3, 3, -1, 0 # encoding: [0xff,0xff,0x00,0x06,0xff,0xff,0x63,0x3c] # psubis 3, 3, -1 -> paddis 3, 3, 1, 0 # 1 = 0x00000001: prefix SI[31:16]=0x0000, instr SI[15:0]=0x0001 # Prefix (BE): 06 00 00 00 # Instr (BE): 3C 63 00 01 psubis 3, 3, -1 # CHECK-BE: paddis 3, 3, 1, 0 # encoding: [0x06,0x00,0x00,0x00,0x3c,0x63,0x00,0x01] # CHECK-LE: paddis 3, 3, 1, 0 # encoding: [0x00,0x00,0x00,0x06,0x01,0x00,0x63,0x3c] # psubis 3, 3, 0x1234 -> paddis 3, 3, -0x1234, 0 # -0x1234 = 0xFFFFEDCC: prefix SI[31:16]=0xFFFF, instr SI[15:0]=0xEDCC # Prefix (BE): 06 00 FF FF # Instr (BE): 3C 63 ED CC psubis 3, 3, 0x1234 # CHECK-BE: paddis 3, 3, -4660, 0 # encoding: [0x06,0x00,0xff,0xff,0x3c,0x63,0xed,0xcc] # CHECK-LE: paddis 3, 3, -4660, 0 # encoding: [0xff,0xff,0x00,0x06,0xcc,0xed,0x63,0x3c] # psubis 3, 3, 0x12345678 -> paddis 3, 3, -0x12345678, 0 # -0x12345678 = 0xEDCBA988: prefix SI[31:16]=0xEDCB, instr SI[15:0]=0xA988 # Prefix (BE): 06 00 ED CB # Instr (BE): 3C 63 A9 88 psubis 3, 3, 0x12345678 # CHECK-BE: paddis 3, 3, -305419896, 0 # encoding: [0x06,0x00,0xed,0xcb,0x3c,0x63,0xa9,0x88] # CHECK-LE: paddis 3, 3, -305419896, 0 # encoding: [0xcb,0xed,0x00,0x06,0x88,0xa9,0x63,0x3c] # psubis 1, 2, 1 -> paddis 1, 2, -1, 0 (different RT and RA) # -1 = 0xFFFFFFFF: prefix SI[31:16]=0xFFFF, instr SI[15:0]=0xFFFF # Prefix (BE): 06 00 FF FF # Instr (BE): 3C 22 FF FF psubis 1, 2, 1 # CHECK-BE: paddis 1, 2, -1, 0 # encoding: [0x06,0x00,0xff,0xff,0x3c,0x22,0xff,0xff] # CHECK-LE: paddis 1, 2, -1, 0 # encoding: [0xff,0xff,0x00,0x06,0xff,0xff,0x22,0x3c] # psubis 1, 2, 0x12345678 -> paddis 1, 2, -0x12345678, 0 # -0x12345678 = 0xEDCBA988: prefix SI[31:16]=0xEDCB, instr SI[15:0]=0xA988 # Prefix (BE): 06 00 ED CB # Instr (BE): 3C 22 A9 88 psubis 1, 2, 0x12345678 # CHECK-BE: paddis 1, 2, -305419896, 0 # encoding: [0x06,0x00,0xed,0xcb,0x3c,0x22,0xa9,0x88] # CHECK-LE: paddis 1, 2, -305419896, 0 # encoding: [0xcb,0xed,0x00,0x06,0x88,0xa9,0x22,0x3c] # psubis 3, 0, 1 -> paddis 3, 0, -1, 0 (RA=0) # -1 = 0xFFFFFFFF: prefix SI[31:16]=0xFFFF, instr SI[15:0]=0xFFFF # Prefix (BE): 06 00 FF FF # Instr (BE): 3C 60 FF FF psubis 3, 0, 1 # CHECK-BE: plis 3, -1 # encoding: [0x06,0x00,0xff,0xff,0x3c,0x60,0xff,0xff] # CHECK-LE: plis 3, -1 # encoding: [0xff,0xff,0x00,0x06,0xff,0xff,0x60,0x3c] # psubis 3, 0, 0x7FFFFFFF -> paddis 3, 0, -0x7FFFFFFF, 0 # -0x7FFFFFFF = 0x80000001: prefix SI[31:16]=0x8000, instr SI[15:0]=0x0001 # Prefix (BE): 06 00 80 00 # Instr (BE): 3C 60 00 01 psubis 3, 0, 0x7FFFFFFF # CHECK-BE: plis 3, -2147483647 # encoding: [0x06,0x00,0x80,0x00,0x3c,0x60,0x00,0x01] # CHECK-LE: plis 3, -2147483647 # encoding: [0x00,0x80,0x00,0x06,0x01,0x00,0x60,0x3c] # psubis with a symbol reference: psubis 3, 3, target # -> paddis 3, 3, -target, 0 # The fixup negates the symbol value; fixup kind is fixup_ppc_imm32. # At encode time SI=0, so: # Prefix (BE): 0x06'A' A A A # Instr (BE): 3C 63 00 00 target: # CHECK-BE: target: # CHECK-LE: target: psubis 3, 3, target # CHECK-BE: paddis 3, 3, -target, 0 # encoding: [0x06'A',A,A,A,0x3c,0x63,0x00,0x00] # CHECK-BE-NEXT: # fixup A - offset: 0, value: -target, kind: fixup_ppc_imm32 # CHECK-LE: paddis 3, 3, -target, 0 # encoding: [A,A,A,0x06'A',0x00,0x00,0x63,0x3c] # CHECK-LE-NEXT: # fixup A - offset: 0, value: -target, kind: fixup_ppc_imm32