diff options
| author | Mike Vink <mike@pionative.com> | 2024-06-14 09:23:32 +0200 |
|---|---|---|
| committer | Mike Vink <mike@pionative.com> | 2024-06-14 09:23:32 +0200 |
| commit | 8092f4c334db547ced59d6f439b558dad35e1ab2 (patch) | |
| tree | fa462fa885efea1ec6095d015286998d632c2c3d /3/11_floating_point/00_float_mov.c | |
| parent | b424517a33bf61aedff29eed74a665402ab496ba (diff) | |
commit for once
Diffstat (limited to '3/11_floating_point/00_float_mov.c')
| -rw-r--r-- | 3/11_floating_point/00_float_mov.c | 11 |
1 files changed, 11 insertions, 0 deletions
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; +} |
