CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
50 lines
1.7 KiB
C
50 lines
1.7 KiB
C
// RUN: %clang -target mipsel-unknown-linux -S -o - -emit-llvm %s \
|
|
// RUN: | FileCheck %s
|
|
|
|
// This checks that the frontend will accept inline asm constraints
|
|
// c', 'l' and 'x'.
|
|
|
|
int main(void)
|
|
{
|
|
// 'c': 16 bit address register for Mips16, GPR for all others
|
|
// I am using 'c' to constrain both the target and one of the source
|
|
// registers. We are looking for syntactical correctness.
|
|
// CHECK: %{{[0-9]+}} = call i32 asm sideeffect "addi $0,$1,$2 \0A\09\09", "=c,c,I,~{$1}"(i32 %{{[0-9]+}}, i32 %{{[0-9]+}}) [[NUW:#[0-9]+]], !srcloc !{{[0-9]+}}
|
|
int __s, __v = 17;
|
|
int __t;
|
|
__asm__ __volatile__(
|
|
"addi %0,%1,%2 \n\t\t"
|
|
: "=c" (__t)
|
|
: "c" (__s), "I" (__v));
|
|
|
|
// 'l': lo register
|
|
// We are making it clear that destination register is lo with the
|
|
// use of the 'l' constraint ("=l").
|
|
// CHECK: %{{[0-9]+}} = call i32 asm sideeffect "mtlo $1 \0A\09\09", "=l,r,~{lo},~{$1}"(i32 %{{[0-9]+}}) [[NUW]], !srcloc !{{[0-9]+}}
|
|
int i_temp = 44;
|
|
int i_result;
|
|
__asm__ __volatile__(
|
|
"mtlo %1 \n\t\t"
|
|
: "=l" (i_result)
|
|
: "r" (i_temp)
|
|
: "lo");
|
|
|
|
// 'x': Combined lo/hi registers
|
|
// We are specifying that destination registers are the hi/lo pair with the
|
|
// use of the 'x' constraint ("=x").
|
|
// CHECK: %{{[0-9]+}} = call i64 asm sideeffect "mthi $1 \0A\09\09mtlo $2 \0A\09\09", "=x,r,r,~{$1}"(i32 %{{[0-9]+}}, i32 %{{[0-9]+}}) [[NUW]], !srcloc !{{[0-9]+}}
|
|
int i_hi = 3;
|
|
int i_lo = 2;
|
|
long long ll_result = 0;
|
|
__asm__ __volatile__(
|
|
"mthi %1 \n\t\t"
|
|
"mtlo %2 \n\t\t"
|
|
: "=x" (ll_result)
|
|
: "r" (i_hi), "r" (i_lo)
|
|
: );
|
|
|
|
return 0;
|
|
}
|
|
|
|
// CHECK: attributes [[NUW]] = { nounwind }
|