mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 03:29:57 +00:00
1b1c8d83d3
Turning on `enable_noundef_analysis` flag allows better codegen by removing freeze instructions. I modified clang by renaming `enable_noundef_analysis` flag to `disable-noundef-analysis` and turning it off by default. Test updates are made as a separate patch: D108453 Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D105169
43 lines
1.7 KiB
C
43 lines
1.7 KiB
C
// RUN: %clang_cc1 -triple sparc-unknown-unknown -emit-llvm %s -o - | FileCheck %s
|
|
|
|
// CHECK: define{{.*}} float @fabsf(float noundef %a)
|
|
// CHECK: %{{.*}} = call float asm sideeffect "fabss $1, $0;", "=e,f"(float %{{.*}})
|
|
float fabsf(float a) {
|
|
float res;
|
|
__asm __volatile__("fabss %1, %0;"
|
|
: /* reg out*/ "=e"(res)
|
|
: /* reg in */ "f"(a));
|
|
return res;
|
|
}
|
|
|
|
void test_gcc_registers(void) {
|
|
register unsigned int regO6 asm("o6") = 0;
|
|
register unsigned int regSP asm("sp") = 1;
|
|
register unsigned int reg14 asm("r14") = 2;
|
|
register unsigned int regI6 asm("i6") = 3;
|
|
register unsigned int regFP asm("fp") = 4;
|
|
register unsigned int reg30 asm("r30") = 5;
|
|
|
|
register float fF20 asm("f20") = 8.0;
|
|
register double dF20 asm("f20") = 11.0;
|
|
register long double qF20 asm("f20") = 14.0;
|
|
|
|
// Test remapping register names in register ... asm("rN") statments.
|
|
|
|
// CHECK: call void asm sideeffect "add $0,$1,$2", "{r14},{r14},{r14}"
|
|
asm volatile("add %0,%1,%2" : : "r" (regO6), "r" (regSP), "r" (reg14));
|
|
|
|
// CHECK: call void asm sideeffect "add $0,$1,$2", "{r30},{r30},{r30}"
|
|
asm volatile("add %0,%1,%2" : : "r" (regI6), "r" (regFP), "r" (reg30));
|
|
|
|
// CHECK: call void asm sideeffect "fadds $0,$1,$2", "{f20},{f20},{f20}"
|
|
asm volatile("fadds %0,%1,%2" : : "f" (fF20), "f" (fF20), "f"(fF20));
|
|
|
|
// CHECK: call void asm sideeffect "faddd $0,$1,$2", "{f20},{f20},{f20}"
|
|
asm volatile("faddd %0,%1,%2" : : "f" (dF20), "f" (dF20), "f"(dF20));
|
|
|
|
// CHECK: call void asm sideeffect "faddq $0,$1,$2", "{f20},{f20},{f20}"
|
|
asm volatile("faddq %0,%1,%2" : : "f" (qF20), "f" (qF20), "f"(qF20));
|
|
|
|
}
|