Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fx_s3132
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
battle_c_4
fx_s3132
Commits
a67c4fac
Commit
a67c4fac
authored
4 years ago
by
Hanjungwoo
Browse files
Options
Downloads
Patches
Plain Diff
fx_s3132_longlong.h type update
parent
93d005b1
Branches
Branches containing commit
No related tags found
1 merge request
!17
fx_s3132_longlong.h type update
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
step2/fx_s3132_longlong.h
+4
-4
4 additions, 4 deletions
step2/fx_s3132_longlong.h
with
4 additions
and
4 deletions
step2/fx_s3132_longlong.h
+
4
−
4
View file @
a67c4fac
...
...
@@ -23,12 +23,12 @@ typedef long long fx_s3132;
//아래 3개는 곱셈 관련 코드입니다.
#define fx32_mul(fa, fb)
(fixed32)
((fa * fb) >> FX32_QNUM ) //fa와 fb를 곱해서 2^32로 나누어 주는 코드입니다. 이게 가장 기본 코드입니다.
#define fx32_mul1(fa, fb) ((
fixed32)(
((fa>>16) * fb)>>16)) //위와 똑같이 fa*fb>>32랑 같은 의미인대, 먼저 fa/2^16와 fb를 곱해주고 나머지 2^16을 나눠주는 작업입니다.
#define fx32_mul2(fa, fb) ((
fixed32)(
((fa>>8)*(fb>>8))>>16)) //위와 똑같이 fa*fb>>32랑 같은 의미인대, 먼저 fa/2^8, fb/2^8을 곱해주고 나머지 2^16을 나눠주는 작업입니다.
#define fx32_mul(fa, fb) ((fa * fb) >> FX32_QNUM ) //fa와 fb를 곱해서 2^32로 나누어 주는 코드입니다. 이게 가장 기본 코드입니다.
#define fx32_mul1(fa, fb) ((((fa>>16) * fb)>>16)) //위와 똑같이 fa*fb>>32랑 같은 의미인대, 먼저 fa/2^16와 fb를 곱해주고 나머지 2^16을 나눠주는 작업입니다.
#define fx32_mul2(fa, fb) ((((fa>>8)*(fb>>8))>>16)) //위와 똑같이 fa*fb>>32랑 같은 의미인대, 먼저 fa/2^8, fb/2^8을 곱해주고 나머지 2^16을 나눠주는 작업입니다.
//아래 3개는 나눗셈 관련 코드입니다.
#define fx32_div(fa, fb) (
fixed32)(
(((fixed64)(fa) << FX32_QNUM) /(fb))) //fa에 2^32을 곱하고 fb를 나눠주는 코드입니다. 이게 가장 기본 코드입니다.
#define fx32_div(fa, fb) ( (((fixed64)(fa) << FX32_QNUM) /(fb))) //fa에 2^32을 곱하고 fb를 나눠주는 코드입니다. 이게 가장 기본 코드입니다.
#define fx32_div1(fa, fb) ((((fa)<<16)/(fb))<<16) //위와 똑같이 (fa<<32)/fb랑 같은 의미인대, 먼저 fa에 2^16을 곱한 값을 fb를 나누고, 그 다음에 나머지 2^16을 곱해주는 작업입니다.
#define fx32_div2(fa, fb) ((((fa)<<24)/(fb))<<8) //위와 똑같이 (fa<<32)/fb랑 같은 의미인대, 먼저 fa에 2^24을 곱한 값을 fb를 나누고, 그 다음에 나머지 2^8을 곱해주는 작업입니다.
//((fa)/((fb)>>FX32_QNUM))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment