diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-09-30 22:50:26 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-09-30 22:53:14 -0700 |
commit | 656b840e7f5ee0eff08729146c4fc797c63968e1 (patch) | |
tree | acea188c1be9794879f10c7e37e28c98061a4e78 /014indirect_addressing.cc | |
parent | d564633b240cfc0e8bfe49098a6ac49abf688a76 (diff) | |
download | mu-656b840e7f5ee0eff08729146c4fc797c63968e1.tar.gz |
6911 - comparing floats
It turns out floating-point operations set different flags than most instructions. We have to branch on them using unsigned jumps. https://stackoverflow.com/questions/7057501/x86-assembler-floating-point-compare/7057771#7057771
Diffstat (limited to '014indirect_addressing.cc')
-rw-r--r-- | 014indirect_addressing.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/014indirect_addressing.cc b/014indirect_addressing.cc index fa679d6f..04b65215 100644 --- a/014indirect_addressing.cc +++ b/014indirect_addressing.cc @@ -538,7 +538,7 @@ void test_compare_mem_at_r32_with_r32_equal() { put_new(Name, "3b", "compare: set SF if r32 < rm32 (cmp)"); :(code) -void test_compare_r32_with_mem_at_r32_greater() { +void test_compare_r32_with_mem_at_rm32_greater() { Reg[EAX].i = 0x2000; Reg[EBX].i = 0x0a0b0c0d; run( @@ -576,7 +576,7 @@ case 0x3b: { // set SF if r32 < r/m32 } :(code) -void test_compare_r32_with_mem_at_r32_lesser_unsigned_and_signed() { +void test_compare_r32_with_mem_at_rm32_lesser_unsigned_and_signed() { Reg[EAX].i = 0x2000; Reg[EBX].i = 0x0a0b0c07; run( @@ -595,7 +595,7 @@ void test_compare_r32_with_mem_at_r32_lesser_unsigned_and_signed() { ); } -void test_compare_r32_with_mem_at_r32_lesser_unsigned_and_signed_due_to_overflow() { +void test_compare_r32_with_mem_at_rm32_lesser_unsigned_and_signed_due_to_overflow() { Reg[EAX].i = 0x2000; Reg[EBX].i = 0x7fffffff; // largest positive signed integer run( @@ -614,7 +614,7 @@ void test_compare_r32_with_mem_at_r32_lesser_unsigned_and_signed_due_to_overflow ); } -void test_compare_r32_with_mem_at_r32_lesser_signed() { +void test_compare_r32_with_mem_at_rm32_lesser_signed() { Reg[EAX].i = 0x2000; Reg[EBX].i = 0xffffffff; // -1 run( @@ -633,7 +633,7 @@ void test_compare_r32_with_mem_at_r32_lesser_signed() { ); } -void test_compare_r32_with_mem_at_r32_lesser_unsigned() { +void test_compare_r32_with_mem_at_rm32_lesser_unsigned() { Reg[EAX].i = 0x2000; Reg[EBX].i = 0x00000001; // 1 run( @@ -652,7 +652,7 @@ void test_compare_r32_with_mem_at_r32_lesser_unsigned() { ); } -void test_compare_r32_with_mem_at_r32_equal() { +void test_compare_r32_with_mem_at_rm32_equal() { Reg[EAX].i = 0x2000; Reg[EBX].i = 0x0a0b0c0d; run( |