Skip to content

Commit

Permalink
Load 0f32 with xor instead of mov
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter committed Mar 25, 2024
1 parent 7bf6f59 commit 51c6410
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions fidget/src/jit/x86_64/grad_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl Assembler for GradSliceAssembler {
; mov [rbp - (input_pos - 0x18)], eax // d/dy(y) = 1
; mov [rbp - (input_pos - 0x2c)], eax // d/dz(z) = 1

; mov eax, 0.0f32.to_bits() as i32
; xor eax, eax // set eax to 0u32, which is also 0f32
; mov [rbp - (input_pos - 0x8)], eax // d/dy(x) = 0
; mov [rbp - (input_pos - 0xc)], eax // d/dz(x) = 0
; mov [rbp - (input_pos - 0x14)], eax // d/dx(y) = 0
Expand Down Expand Up @@ -395,7 +395,7 @@ impl Assembler for GradSliceAssembler {
; jb >L

// Fall-through for equal
; mov eax, 0f32.to_bits() as i32
; xor eax, eax // set eax to 0u32, which is also 0f32
; vmovd Rx(reg(out_reg)), eax
; jmp >O

Expand Down
2 changes: 1 addition & 1 deletion fidget/src/jit/x86_64/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ impl Assembler for PointAssembler {
; jb >L

// Fall-through for equal
; mov eax, 0f32.to_bits() as i32
; xor eax, eax // set eax to 0u32, which is also 0f32
; vmovd Rx(reg(out_reg)), eax
; jmp >O

Expand Down

0 comments on commit 51c6410

Please sign in to comment.