[go: nahoru, domu]

Skip to content

Commit

Permalink
gcc compatibility for PSIMD functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Maratyszcza committed Mar 23, 2017
1 parent a8f140a commit 4b29617
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/fp16/psimd.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ PSIMD_INTRINSIC psimd_f32 fp16_alt_to_fp32_psimd(psimd_u16 half) {

#if 0
const psimd_s32 exp112_offset = psimd_splat_s32(INT32_C(0x38000000));
const psimd_s32 nonsign_bits = shr3_nonsign + exp112_offset;
const psimd_s32 nonsign_bits = (psimd_s32) shr3_nonsign + exp112_offset;
const psimd_s32 exp1_offset = psimd_splat_s32(INT32_C(0x00800000));
const psimd_f32 two_nonsign = (psimd_f32) (nonsign_bits + exp1_offset);
const psimd_s32 exp113_offset = exp112_offset | exp1_offset;
Expand All @@ -94,12 +94,12 @@ PSIMD_INTRINSIC psimd_f32x2 fp16_alt_to_fp32x2_psimd(psimd_u16 half) {

#if 1
const psimd_s32 exp112_offset = psimd_splat_s32(INT32_C(0x38000000));
const psimd_s32 nonsign_bits_lo = shr3_nonsign_lo + exp112_offset;
const psimd_s32 nonsign_bits_hi = shr3_nonsign_hi + exp112_offset;
const psimd_s32 nonsign_bits_lo = (psimd_s32) shr3_nonsign_lo + exp112_offset;
const psimd_s32 nonsign_bits_hi = (psimd_s32) shr3_nonsign_hi + exp112_offset;
const psimd_s32 exp1_offset = psimd_splat_s32(INT32_C(0x00800000));
const psimd_f32 two_nonsign_lo = (psimd_f32) (nonsign_bits_lo + exp1_offset);
const psimd_f32 two_nonsign_hi = (psimd_f32) (nonsign_bits_hi + exp1_offset);
const psimd_f32 exp113_offset = exp1_offset | exp112_offset;
const psimd_s32 exp113_offset = exp1_offset | exp112_offset;
psimd_f32x2 result;
result.lo = (psimd_f32) (sign_lo | (psimd_s32) (two_nonsign_lo - (psimd_f32) psimd_max_s32(nonsign_bits_lo, exp113_offset)));
result.hi = (psimd_f32) (sign_hi | (psimd_s32) (two_nonsign_hi - (psimd_f32) psimd_max_s32(nonsign_bits_hi, exp113_offset)));
Expand Down

0 comments on commit 4b29617

Please sign in to comment.