From 8092f4c334db547ced59d6f439b558dad35e1ab2 Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Fri, 14 Jun 2024 09:23:32 +0200 Subject: commit for once --- 3/11_floating_point/00_float_mov.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 3/11_floating_point/00_float_mov.c (limited to '3/11_floating_point/00_float_mov.c') diff --git a/3/11_floating_point/00_float_mov.c b/3/11_floating_point/00_float_mov.c new file mode 100644 index 0000000..dd0379d --- /dev/null +++ b/3/11_floating_point/00_float_mov.c @@ -0,0 +1,11 @@ +// v1 in %xmm0, src in %rdi, dst in %rsi +// float_mov: +// vmovaps %xmm0, %xmm1 Copy v1 +// vmovss (%rdi), %xmm0 Read v2 from src +// vmovss %xmm1, (%rsi) Write v1 to dst +// ret; +float float_mov(float v1, float *src, float *dst) { + float v2 = *src; + *dst = v1; + return v2; +} -- cgit v1.2.3