Index: include/clang/Basic/BuiltinsARM.def =================================================================== --- include/clang/Basic/BuiltinsARM.def +++ include/clang/Basic/BuiltinsARM.def @@ -48,6 +48,16 @@ BUILTIN(__builtin_arm_vcvtr_d, "fdi", "nc") // Coprocessor +BUILTIN(__builtin_arm_ldc, "vUIiUIivC*", "") +BUILTIN(__builtin_arm_ldcl, "vUIiUIivC*", "") +BUILTIN(__builtin_arm_ldc2, "vUIiUIivC*", "") +BUILTIN(__builtin_arm_ldc2l, "vUIiUIivC*", "") + +BUILTIN(__builtin_arm_stc, "vUIiUIiv*", "") +BUILTIN(__builtin_arm_stcl, "vUIiUIiv*", "") +BUILTIN(__builtin_arm_stc2, "vUIiUIiv*", "") +BUILTIN(__builtin_arm_stc2l, "vUIiUIiv*", "") + BUILTIN(__builtin_arm_mcr, "vUIiUIiUiUIiUIiUIi", "") BUILTIN(__builtin_arm_mcr2, "vUIiUIiUiUIiUIiUIi", "") BUILTIN(__builtin_arm_mrc, "UiUIiUIiUIiUIiUIi", "") Index: test/CodeGen/builtins-arm.c =================================================================== --- test/CodeGen/builtins-arm.c +++ test/CodeGen/builtins-arm.c @@ -84,6 +84,62 @@ // CHECK: call {{.*}} @llvm.prefetch(i8* %{{.*}}, i32 1, i32 3, i32 0) } +void ldc(const void *i) { + // CHECK: define void @ldc(i8* %i) + // CHECK: call void @llvm.arm.ldc(i32 1, i32 2, i8* %i) + // CHECK-NEXT: ret void + __builtin_arm_ldc(1, 2, i); +} + +void ldcl(const void *i) { + // CHECK: define void @ldcl(i8* %i) + // CHECK: call void @llvm.arm.ldcl(i32 1, i32 2, i8* %i) + // CHECK-NEXT: ret void + __builtin_arm_ldcl(1, 2, i); +} + +void ldc2(const void *i) { + // CHECK: define void @ldc2(i8* %i) + // CHECK: call void @llvm.arm.ldc2(i32 1, i32 2, i8* %i) + // CHECK-NEXT: ret void + __builtin_arm_ldc2(1, 2, i); +} + +void ldc2l(const void *i) { + // CHECK: define void @ldc2l(i8* %i) + // CHECK: call void @llvm.arm.ldc2l(i32 1, i32 2, i8* %i) + // CHECK-NEXT: ret void + __builtin_arm_ldc2l(1, 2, i); +} + +void stc(void *i) { + // CHECK: define void @stc(i8* %i) + // CHECK: call void @llvm.arm.stc(i32 1, i32 2, i8* %i) + // CHECK-NEXT: ret void + __builtin_arm_stc(1, 2, i); +} + +void stcl(void *i) { + // CHECK: define void @stcl(i8* %i) + // CHECK: call void @llvm.arm.stcl(i32 1, i32 2, i8* %i) + // CHECK-NEXT: ret void + __builtin_arm_stcl(1, 2, i); +} + +void stc2(void *i) { + // CHECK: define void @stc2(i8* %i) + // CHECK: call void @llvm.arm.stc2(i32 1, i32 2, i8* %i) + // CHECK-NEXT: ret void + __builtin_arm_stc2(1, 2, i); +} + +void stc2l(void *i) { + // CHECK: define void @stc2l(i8* %i) + // CHECK: call void @llvm.arm.stc2l(i32 1, i32 2, i8* %i) + // CHECK-NEXT: ret void + __builtin_arm_stc2l(1, 2, i); +} + void cdp() { // CHECK: define void @cdp() // CHECK: call void @llvm.arm.cdp(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6) Index: test/Sema/builtins-arm.c =================================================================== --- test/Sema/builtins-arm.c +++ test/Sema/builtins-arm.c @@ -48,6 +48,38 @@ } void test6(int a, int b, int c) { + __builtin_arm_ldc(1, 2, &a); + __builtin_arm_ldc(a, 2, &a); // expected-error {{argument to '__builtin_arm_ldc' must be a constant integer}} + __builtin_arm_ldc(1, a, &a); // expected-error {{argument to '__builtin_arm_ldc' must be a constant integer}} + + __builtin_arm_ldcl(1, 2, &a); + __builtin_arm_ldcl(a, 2, &a); // expected-error {{argument to '__builtin_arm_ldcl' must be a constant integer}} + __builtin_arm_ldcl(1, a, &a); // expected-error {{argument to '__builtin_arm_ldcl' must be a constant integer}} + + __builtin_arm_ldc2(1, 2, &a); + __builtin_arm_ldc2(a, 2, &a); // expected-error {{argument to '__builtin_arm_ldc2' must be a constant integer}} + __builtin_arm_ldc2(1, a, &a); // expected-error {{argument to '__builtin_arm_ldc2' must be a constant integer}} + + __builtin_arm_ldc2l(1, 2, &a); + __builtin_arm_ldc2l(a, 2, &a); // expected-error {{argument to '__builtin_arm_ldc2l' must be a constant integer}} + __builtin_arm_ldc2l(1, a, &a); // expected-error {{argument to '__builtin_arm_ldc2l' must be a constant integer}} + + __builtin_arm_stc(1, 2, &a); + __builtin_arm_stc(a, 2, &a); // expected-error {{argument to '__builtin_arm_stc' must be a constant integer}} + __builtin_arm_stc(1, a, &a); // expected-error {{argument to '__builtin_arm_stc' must be a constant integer}} + + __builtin_arm_stcl(1, 2, &a); + __builtin_arm_stcl(a, 2, &a); // expected-error {{argument to '__builtin_arm_stcl' must be a constant integer}} + __builtin_arm_stcl(1, a, &a); // expected-error {{argument to '__builtin_arm_stcl' must be a constant integer}} + + __builtin_arm_stc2(1, 2, &a); + __builtin_arm_stc2(a, 2, &a); // expected-error {{argument to '__builtin_arm_stc2' must be a constant integer}} + __builtin_arm_stc2(1, a, &a); // expected-error {{argument to '__builtin_arm_stc2' must be a constant integer}} + + __builtin_arm_stc2l(1, 2, &a); + __builtin_arm_stc2l(a, 2, &a); // expected-error {{argument to '__builtin_arm_stc2l' must be a constant integer}} + __builtin_arm_stc2l(1, a, &a); // expected-error {{argument to '__builtin_arm_stc2l' must be a constant integer}} + __builtin_arm_cdp(a, 2, 3, 4, 5, 6); // expected-error {{argument to '__builtin_arm_cdp' must be a constant integer}} __builtin_arm_cdp(1, a, 3, 4, 5, 6); // expected-error {{argument to '__builtin_arm_cdp' must be a constant integer}} __builtin_arm_cdp(1, 2, a, 4, 5, 6); // expected-error {{argument to '__builtin_arm_cdp' must be a constant integer}}