diff --git a/section_1/float/t.s b/section_1/float/t.s deleted file mode 100644 index ae1b890..0000000 --- a/section_1/float/t.s +++ /dev/null @@ -1,16 +0,0 @@ - .text - .global main - .align 2 - -main: str x30, [sp, -16]! - ldr s0, =0x3fc00000 - fcvt d0, s0 - ldr x0, =fmt - bl printf - ldr x30, [sp], 16 - mov w0, wzr - ret - - .data -fmt: .asciz "%f\n" - .end diff --git a/section_1/float/test.cpp b/section_1/float/test.cpp new file mode 100644 index 0000000..466479b --- /dev/null +++ b/section_1/float/test.cpp @@ -0,0 +1,21 @@ +#include + +extern "C" uint32_t T1(double d) { + return uint32_t(d); +} + +extern "C" uint32_t T2(float f) { + return uint32_t(f); +} + +extern "C" int32_t T3(double d) { + return int32_t(d); +} + +extern "C" int32_t T4(float f) { + return int32_t(f); +} + +extern "C" uint64_t T5(double d) { + return uint64_t(d); +}