[AMDGPU] Refactor waitcnt encoding
authorKonstantin Zhuravlyov <kzhuravl_dev@outlook.com>
Tue, 11 Oct 2016 18:58:22 +0000 (18:58 +0000)
committerKonstantin Zhuravlyov <kzhuravl_dev@outlook.com>
Tue, 11 Oct 2016 18:58:22 +0000 (18:58 +0000)
commitcdd4547607128d41b3f224b0790a761d34c000eb
treefb888bb5afc38818f2a7fe276ea36ab09a2e3873
parente9d075233a2b264e7b6f4eeb03d03c3df6195280
[AMDGPU] Refactor waitcnt encoding

- Refactor bit packing/unpacking
- Calculate bit mask given bit shift and bit width
- Introduce function for decoding bits of waitcnt
- Introduce function for encoding bits of waitcnt
- Introduce function for getting waitcnt mask (instead of using bare numbers)
- Introduce function fot getting max waitcnt(s) (instead of using bare numbers)

Differential Revision: https://reviews.llvm.org/D25298

llvm-svn: 283919
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp
llvm/lib/Target/AMDGPU/SIInsertWaits.cpp
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h