131 lines · c
1// RUN: %clang_cc1 -O2 -emit-llvm %s -o - -triple aarch64 | FileCheck %s2 3int test_cceq(int a, int* b) {4// CHECK-LABEL: @test_cceq5// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cceq},0"(i32 %a)6 asm("ands %w[a], %w[a], #3"7 : [a] "+r"(a), "=@cceq"(*b));8 return a;9}10 11int test_ccne(int a, int* b) {12// CHECK-LABEL: @test_ccne13// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccne},0"(i32 %a)14 asm("ands %w[a], %w[a], #3"15 : [a] "+r"(a), "=@ccne"(*b));16 return a;17}18 19int test_cccs(int a, int* b) {20// CHECK-LABEL: @test_cccs21// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cccs},0"(i32 %a)22 asm("ands %w[a], %w[a], #3"23 : [a] "+r"(a), "=@cccs"(*b));24 return a;25}26 27int test_cchs(int a, int* b) {28// CHECK-LABEL: @test_cchs29// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cchs},0"(i32 %a)30 asm("ands %w[a], %w[a], #3"31 : [a] "+r"(a), "=@cchs"(*b));32 return a;33}34 35int test_cccc(int a, int* b) {36// CHECK-LABEL: @test_cccc37// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cccc},0"(i32 %a)38 asm("ands %w[a], %w[a], #3"39 : [a] "+r"(a), "=@cccc"(*b));40 return a;41}42 43int test_cclo(int a, int* b) {44// CHECK-LABEL: @test_cclo45// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cclo},0"(i32 %a)46 asm("ands %w[a], %w[a], #3"47 : [a] "+r"(a), "=@cclo"(*b));48 return a;49}50 51int test_ccmi(int a, int* b) {52// CHECK-LABEL: @test_ccmi53// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccmi},0"(i32 %a)54 asm("ands %w[a], %w[a], #3"55 : [a] "+r"(a), "=@ccmi"(*b));56 return a;57}58 59int test_ccpl(int a, int* b) {60// CHECK-LABEL: @test_ccpl61// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccpl},0"(i32 %a)62 asm("ands %w[a], %w[a], #3"63 : [a] "+r"(a), "=@ccpl"(*b));64 return a;65}66 67int test_ccvs(int a, int* b) {68// CHECK-LABEL: @test_ccvs69// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccvs},0"(i32 %a)70 asm("ands %w[a], %w[a], #3"71 : [a] "+r"(a), "=@ccvs"(*b));72 return a;73}74 75int test_ccvc(int a, int* b) {76// CHECK-LABEL: @test_ccvc77// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccvc},0"(i32 %a)78 asm("ands %w[a], %w[a], #3"79 : [a] "+r"(a), "=@ccvc"(*b));80 return a;81}82 83int test_cchi(int a, int* b) {84// CHECK-LABEL: @test_cchi85// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cchi},0"(i32 %a)86 asm("ands %w[a], %w[a], #3"87 : [a] "+r"(a), "=@cchi"(*b));88 return a;89}90 91int test_ccls(int a, int* b) {92// CHECK-LABEL: @test_ccls93// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccls},0"(i32 %a)94 asm("ands %w[a], %w[a], #3"95 : [a] "+r"(a), "=@ccls"(*b));96 return a;97}98 99 100int test_ccge(int a, int* b) {101// CHECK-LABEL: @test_ccge102// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccge},0"(i32 %a)103 asm("ands %w[a], %w[a], #3"104 : [a] "+r"(a), "=@ccge"(*b));105 return a;106}107 108int test_cclt(int a, int* b) {109// CHECK-LABEL: @test_cclt110// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cclt},0"(i32 %a)111 asm("ands %w[a], %w[a], #3"112 : [a] "+r"(a), "=@cclt"(*b));113 return a;114}115 116int test_ccgt(int a, int* b) {117// CHECK-LABEL: @test_ccgt118// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccgt},0"(i32 %a)119 asm("ands %w[a], %w[a], #3"120 : [a] "+r"(a), "=@ccgt"(*b));121 return a;122}123 124int test_ccle(int a, int* b) {125// CHECK-LABEL: @test_ccle126// CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccle},0"(i32 %a)127 asm("ands %w[a], %w[a], #3"128 : [a] "+r"(a), "=@ccle"(*b));129 return a;130}131