Verified Commit b2e406b3 authored by jD91mZM2's avatar jD91mZM2

Build float example without sse

parent e1ca8a16
......@@ -6,7 +6,7 @@ clean:
%-asm.o: %.asm
nix-shell -p nasm --run "nasm -f elf64 $< -g -o $@"
%-c: %.c
nix-shell -p musl --run "musl-gcc -g -static $< -o $@"
nix-shell -p musl --run "musl-gcc -mno-sse -g -static $< -o $@"
%: %.o
ld "$<" -o "$@"
......
......@@ -2,13 +2,13 @@
#include <stdio.h>
int main() {
float f1 = 0.1;
float f2 = 0.2;
volatile float f1 = 0.1;
volatile float f2 = 0.2;
float f3 = f1 + f2;
printf("%g + %g = %g\n", (double) f1, (double) f2, (double) f3);
double d1 = 0.1;
double d2 = 0.2;
volatile double d1 = 0.1;
volatile double d2 = 0.2;
double d3 = d1 + d2;
printf("%g + %g = %g\n", d1, d2, d3);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment