142 lines · plain
1# RUN: llc %s -mtriple=x86_64-unknown -mattr=+ndd,+egpr -start-before=x86-compress-evex -show-mc-encoding -o - | FileCheck --check-prefixes=CHECK,NDD %s2# RUN: llc %s -mtriple=x86_64-unknown -mattr=+ndd,+egpr,+nf -start-before=x86-compress-evex -show-mc-encoding -o - | FileCheck --check-prefixes=CHECK,NDD-NF %s3# RUN: llc %s -mtriple=x86_64-unknown -mattr=+ndd,+egpr,+nf -x86-enable-apx-for-relocation=true -start-before=x86-compress-evex -show-mc-encoding -o - | FileCheck --check-prefixes=CHECK,NDD-NF %s4 5...6---7name: ndd_2_non_ndd_xor8body: |9 bb.0.entry:10 liveins: $rdi, $rsi11 ; CHECK: xorq %rsi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x31,0xf0]12 renamable $rax = ADD64rr_ND killed renamable $rdi, renamable $rsi, implicit-def dead $eflags13 renamable $rax = XOR64rr_ND killed renamable $rax, killed renamable $rsi, implicit-def dead $eflags14 RET64 $rax15...16---17name: ndd_2_non_ndd_sub18body: |19 bb.0.entry:20 liveins: $rdi, $rsi21 ; CHECK: subq %rsi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x29,0xf0]22 renamable $rax = ADD64rr_ND killed renamable $rdi, renamable $rsi, implicit-def dead $eflags23 renamable $rax = SUB64rr_ND killed renamable $rax, killed renamable $rsi, implicit-def dead $eflags24 RET64 $rax25...26---27name: ndd_2_non_ndd_commutable28body: |29 bb.0.entry:30 liveins: $rdi, $rsi31 ; CHECK: xorq %rsi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x31,0xf0]32 renamable $rax = ADD64rr_ND killed renamable $rdi, renamable $rsi, implicit-def dead $eflags33 renamable $rax = XOR64rr_ND killed renamable $rsi, killed renamable $rax, implicit-def dead $eflags34 RET64 $rax35...36---37name: ndd_2_non_ndd_commutable_new_opcode38body: |39 bb.0.entry:40 liveins: $rdi, $rsi41 ; CHECK: shldq $52, %rsi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x0f,0xa4,0xf0,0x34]42 renamable $rax = ADD64rr_ND killed renamable $rdi, renamable $rsi, implicit-def dead $eflags43 renamable $rax = SHRD64rri8_ND killed renamable $rsi, killed renamable $rax, 12, implicit-def dead $eflags44 RET64 $rax45...46---47name: ndd_2_non_ndd_incommutable48body: |49 bb.0.entry:50 liveins: $rdi, $rsi51 ; NDD: subq %rax, %rsi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0x29,0xc6]52 ; NDD-NF: {nf} subq %rax, %rsi, %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0x29,0xc6]53 renamable $rax = ADD64rr_ND killed renamable $rdi, renamable $rsi, implicit-def dead $eflags54 renamable $rax = SUB64rr_ND killed renamable $rsi, killed renamable $rax, implicit-def dead $eflags55 RET64 $rax56...57---58name: ndd_2_non_ndd_mem59body: |60 bb.0.entry:61 ; NDD: addq $123456, (%rax), %rax # encoding: [0x62,0xf4,0xfc,0x18,0x81,0x00,0x40,0xe2,0x01,0x00]62 ; NDD-NF: {nf} addq $123456, (%rax), %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0x81,0x00,0x40,0xe2,0x01,0x00]63 renamable $rax = MOV64rm $noreg, 1, $noreg, 0, $fs64 renamable $rax = nsw ADD64mi32_ND killed renamable $rax, 1, $noreg, 0, $noreg, 123456, implicit-def dead $eflags65 RET64 $rax66...67---68name: ndd_2_non_ndd_egpr69body: |70 bb.0.entry:71 liveins: $rdi, $r1672 ; CHECK: xorq %r16, %rax # EVEX TO LEGACY Compression encoding: [0xd5,0x48,0x31,0xc0]73 renamable $rax = ADD64rr_ND killed renamable $rdi, renamable $r16, implicit-def dead $eflags74 renamable $rax = XOR64rr_ND killed renamable $rax, killed renamable $r16, implicit-def dead $eflags75 RET64 $rax76...77---78name: ndd_2_non_ndd_egpr_nf79body: |80 bb.0.entry:81 liveins: $rdi, $r1682 ; CHECK: {nf} xorq %r16, %rax # EVEX TO EVEX Compression encoding: [0x62,0xe4,0xfc,0x0c,0x31,0xc0]83 renamable $rax = ADD64rr_ND killed renamable $rdi, renamable $r16, implicit-def dead $eflags84 renamable $rax = XOR64rr_NF_ND killed renamable $rax, killed renamable $r1685 RET64 $rax86...87---88name: bswapr_to_movberr89body: |90 bb.0.entry:91 liveins: $rax92 ; CHECK: bswapq %rax # EVEX TO LEGACY Compression encoding: [0x48,0x0f,0xc8]93 renamable $rax = MOVBE64rr killed renamable $rax94 RET64 killed $rax95...96---97name: non_nf_2_nf98body: |99 bb.0.entry:100 liveins: $rdi, $r16101 ; CHECK: addq %r16, %rdi # encoding: [0xd5,0x48,0x01,0xc7]102 ; NDD: xorq %r16, %rdi, %rax # encoding: [0x62,0xe4,0xfc,0x18,0x31,0xc7]103 ; NDD-NF: {nf} xorq %r16, %rdi, %rax # EVEX TO EVEX Compression encoding: [0x62,0xe4,0xfc,0x1c,0x31,0xc7]104 ; CHECK: addq %r16, %rax, %rdi # encoding: [0x62,0xe4,0xc4,0x18,0x01,0xc0]105 ; CHECK: adcq %rdi, %r16, %rax # encoding: [0x62,0xfc,0xfc,0x18,0x11,0xf8]106 $rdi = ADD64rr $rdi, $r16, implicit-def dead $eflags107 $rax = XOR64rr_ND $rdi, $r16, implicit-def dead $eflags108 $rdi = ADD64rr_ND $rax, $r16, implicit-def $eflags109 $rax = ADC64rr_ND $r16, $rdi, implicit-def dead $eflags, implicit $eflags110 RET64 $rax111...112---113name: cfcmov_no_convert114body: |115 bb.0.entry:116 liveins: $eflags, $rax, $rbx117 ; CHECK: cfcmovew %bx, %ax, %ax # encoding: [0x62,0xf4,0x7d,0x1c,0x44,0xc3]118 ; CHECK: cfcmovsw 24(%rax), %bx, %bx # encoding: [0x62,0xf4,0x65,0x1c,0x48,0x58,0x18]119 ; CHECK: cfcmovel %ebx, %eax, %eax # encoding: [0x62,0xf4,0x7c,0x1c,0x44,0xc3]120 ; CHECK: cfcmovsl 24(%rax), %ebx, %ebx # encoding: [0x62,0xf4,0x64,0x1c,0x48,0x58,0x18]121 ; CHECK: cfcmoveq %rbx, %rax, %rax # encoding: [0x62,0xf4,0xfc,0x1c,0x44,0xc3]122 ; CHECK: cfcmovsq 24(%rax), %rbx, %rbx # encoding: [0x62,0xf4,0xe4,0x1c,0x48,0x58,0x18]123 $ax = CFCMOV16rr_ND $ax, $bx, 4, implicit $eflags124 $bx = CFCMOV16rm_ND $bx, $rax, 1, $noreg, 24, $noreg, 8, implicit $eflags125 $eax = CFCMOV32rr_ND $eax, $ebx, 4, implicit $eflags126 $ebx = CFCMOV32rm_ND $ebx, $rax, 1, $noreg, 24, $noreg, 8, implicit $eflags127 $rax = CFCMOV64rr_ND $rax, $rbx, 4, implicit $eflags128 $rbx = CFCMOV64rm_ND $rbx, $rax, 1, $noreg, 24, $noreg, 8, implicit $eflags129 RET64 $rax130...131---132name: no_convert_8bit_16bit133body: |134 bb.0.entry:135 liveins: $di, $si, $ax136 ; CHECK: addb %sil, %dil # EVEX TO LEGACY Compression encoding: [0x40,0x00,0xf7]137 ; CHECK: xorw %di, %ax # EVEX TO LEGACY Compression encoding: [0x66,0x31,0xf8]138 $dil = ADD8rr_ND $dil, killed $sil, implicit-def dead $eflags139 $ax = XOR16rr_ND $ax, killed $di, implicit-def dead $eflags140 RET64 $rax141...142