diff options
author | Andrea Fioraldi <andreafioraldi@gmail.com> | 2019-12-02 14:34:21 +0100 |
---|---|---|
committer | Andrea Fioraldi <andreafioraldi@gmail.com> | 2019-12-02 14:34:21 +0100 |
commit | 124ec8d297269b6b3066123782a7e92c802d2248 (patch) | |
tree | f18a4a42111ea2faa08ef2183d995aa254146e7b /qemu_mode/patches/afl-qemu-floats.h | |
parent | e9ed056913b4ce711ae47699c1937779036259e7 (diff) | |
download | afl++-124ec8d297269b6b3066123782a7e92c802d2248.tar.gz |
code format (contributors, do it!)
Diffstat (limited to 'qemu_mode/patches/afl-qemu-floats.h')
-rw-r--r-- | qemu_mode/patches/afl-qemu-floats.h | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/qemu_mode/patches/afl-qemu-floats.h b/qemu_mode/patches/afl-qemu-floats.h index 0b2ac2ae..7fea04e7 100644 --- a/qemu_mode/patches/afl-qemu-floats.h +++ b/qemu_mode/patches/afl-qemu-floats.h @@ -35,24 +35,30 @@ #include "afl-qemu-common.h" union afl_float32 { + float32 f; struct { - u64 sign : 1; - u64 exp : 7; + + u64 sign : 1; + u64 exp : 7; u64 frac : 24; + }; -}; +}; union afl_float64 { + float64 f; struct { - u64 sign : 1; - u64 exp : 11; + + u64 sign : 1; + u64 exp : 11; u64 frac : 52; + }; -}; +}; // TODO 16 and 128 bits floats // TODO figure out why float*_unpack_canonical does not work @@ -65,11 +71,11 @@ void afl_float_compcov_log_32(target_ulong cur_loc, float32 arg1, float32 arg2, if (cur_loc >= afl_inst_rms) return; - //float_status* s = (float_status*)status; - //FloatParts a = float32_unpack_canonical(arg1, s); - //FloatParts b = float32_unpack_canonical(arg2, s); - union afl_float32 a = { .f = arg1 }; - union afl_float32 b = { .f = arg2 }; + // float_status* s = (float_status*)status; + // FloatParts a = float32_unpack_canonical(arg1, s); + // FloatParts b = float32_unpack_canonical(arg2, s); + union afl_float32 a = {.f = arg1}; + union afl_float32 b = {.f = arg2}; // if (is_nan(a.cls) || is_nan(b.cls)) return; @@ -97,11 +103,11 @@ void afl_float_compcov_log_64(target_ulong cur_loc, float64 arg1, float64 arg2, if (cur_loc >= afl_inst_rms) return; - //float_status* s = (float_status*)status; - //FloatParts a = float64_unpack_canonical(arg1, s); - //FloatParts b = float64_unpack_canonical(arg2, s); - union afl_float64 a = { .f = arg1 }; - union afl_float64 b = { .f = arg2 }; + // float_status* s = (float_status*)status; + // FloatParts a = float64_unpack_canonical(arg1, s); + // FloatParts b = float64_unpack_canonical(arg2, s); + union afl_float64 a = {.f = arg1}; + union afl_float64 b = {.f = arg2}; // if (is_nan(a.cls) || is_nan(b.cls)) return; @@ -196,7 +202,7 @@ void afl_float_compcov_log_80(target_ulong cur_loc, floatx80 arg1, if ((arg1.low & 0xff00) == (arg2.low & 0xff00)) { INC_AFL_AREA(idx + 9); - //if ((arg1.low & 0xff) == (arg2.low & 0xff)) + // if ((arg1.low & 0xff) == (arg2.low & 0xff)) // INC_AFL_AREA(idx + 10); } |