[PATCH] D18533: Fixing PR26558: the adc builtins do not require the adx target attribute

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 29 15:56:23 PDT 2016


Yunzhong Gao <Yunzhong_Gao at playstation.sony.com> writes:
> ygao created this revision.
> ygao added subscribers: craig.topper, bogner, cfe-commits.
>
> Hi,
> The addcarry and subborrow variants of the builtins do not require the
> adx target attribute. Only the addcarryx variants require them.
> This patch attempts to remove the target attribute requirements from
> these builtins, and also to update the test (run the same test without
> adx and make sure nothing breaks).
> Could you review?

Yep, only the ADCX instruction needs adx. This LGTM, but please just
remove "-target-feature +adx" from the run line instead of adding a
second run line.

> Many thanks,
> - Gao
>
> http://reviews.llvm.org/D18533
>
> Files:
>   include/clang/Basic/BuiltinsX86.def
>   test/CodeGen/adc-builtins.c
>
> Index: test/CodeGen/adc-builtins.c
> ===================================================================
> --- test/CodeGen/adc-builtins.c
> +++ test/CodeGen/adc-builtins.c
> @@ -1,4 +1,5 @@
>  // RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-feature +adx -emit-llvm -o - %s | FileCheck %s
> +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
>  
>  #define __MM_MALLOC_H
>  
> Index: include/clang/Basic/BuiltinsX86.def
> ===================================================================
> --- include/clang/Basic/BuiltinsX86.def
> +++ include/clang/Basic/BuiltinsX86.def
> @@ -690,10 +690,10 @@
>  // ADX
>  TARGET_BUILTIN(__builtin_ia32_addcarryx_u32, "UcUcUiUiUi*", "", "adx")
>  TARGET_BUILTIN(__builtin_ia32_addcarryx_u64, "UcUcULLiULLiULLi*", "", "adx")
> -TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "adx")
> -TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "adx")
> -TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "adx")
> -TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "adx")
> +TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "")
> +TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "")
> +TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "")
> +TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "")
>  
>  // RDSEED
>  TARGET_BUILTIN(__builtin_ia32_rdseed16_step, "UiUs*", "", "rdseed")
>
>
> Index: test/CodeGen/adc-builtins.c
> ===================================================================
> --- test/CodeGen/adc-builtins.c
> +++ test/CodeGen/adc-builtins.c
> @@ -1,4 +1,5 @@
>  // RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-feature +adx -emit-llvm -o - %s | FileCheck %s
> +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
>  
>  #define __MM_MALLOC_H
>  
> Index: include/clang/Basic/BuiltinsX86.def
> ===================================================================
> --- include/clang/Basic/BuiltinsX86.def
> +++ include/clang/Basic/BuiltinsX86.def
> @@ -690,10 +690,10 @@
>  // ADX
>  TARGET_BUILTIN(__builtin_ia32_addcarryx_u32, "UcUcUiUiUi*", "", "adx")
>  TARGET_BUILTIN(__builtin_ia32_addcarryx_u64, "UcUcULLiULLiULLi*", "", "adx")
> -TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "adx")
> -TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "adx")
> -TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "adx")
> -TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "adx")
> +TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "")
> +TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "")
> +TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "")
> +TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "")
>  
>  // RDSEED
>  TARGET_BUILTIN(__builtin_ia32_rdseed16_step, "UiUs*", "", "rdseed")


More information about the cfe-commits mailing list