Cray Assembly Language (CAL) for Cray X1TM Systems Reference Manual


Table of Contents
Preface
Accessing Cray Documentation
Error Message Explanations
Typographical Conventions
Ordering Documentation
Reader Comments
1. Introduction
1.1. Capabilities
1.2. Related Publications
2. Cray X1 Instruction Set Overview
2.1. Data Types
2.1.1. Integer
2.1.2. Floating-point
2.1.3. Addresses
2.2. Registers
2.2.1. Address and Scalar Registers
2.2.2. Vector Registers
2.2.3. Vector Length Register
2.2.4. Mask Registers
2.2.5. Vector Carry Register
2.2.6. Bit Matrix Multiply Register
2.2.7. Control Registers
2.2.8. Program Counter
2.2.9. Performance Counters
2.3. CAL Source Statement Format
2.4. Scalar Instructions
2.4.1. Immediate Loads
2.4.2. Scalar Memory References
2.4.3. Branches and Jumps
2.4.4. Scalar Integer Functions
2.4.5. Scalar Floating-point Functions
2.4.6. Bit Matrix Multiplication
2.4.7. Byte and Halfword Access
2.4.8. Scalar Atomic Memory Operations
2.4.9. Other Scalar Instructions
2.5. Vector Instructions
2.5.1. Elemental Vector Operations
2.5.2. Vector Memory References
2.5.3. Elemental Vector Functions
2.5.4. Mask Operations
2.5.5. Other Vector Instructions
2.6. Memory Ordering
2.7. Summary of Rules
2.8. Special Syntax Forms
3. CAL Pseudo Instruction Overview
3.1. Pseudo Instruction Format
3.2. Program Control
3.3. Loader Linkage
3.4. Mode Control
3.5. Section Control
3.6. Message Control
3.7. Listing Control
3.8. Symbol Definition
3.9. Data Definition
3.10. Conditional Assembly
3.11. Micro Definition
3.12. Defined Sequences
3.13. File Control
4. CAL Program Organization
4.1. Program Modules
4.2. Global Definitions and Local Definitions
4.3. Program Segments
4.4. Program
4.5. Sections
4.6. Examples
4.6.1. Example 1: Global and Local Definitions
4.6.2. Example 2: Sections and Qualifiers
5. CAL Assembler Invocation
5.1. Assembler Command Line
5.2. Environment Variables
5.2.1. ASDEF Environment Variable
5.2.2. LPP Environment Variable
5.2.3. TMPDIR Environment Variable
5.2.4. TARGET Shell Variable
5.3. Assembler Execution
5.3.1. Reading Source Files
5.3.2. Using Binary Definition Files
5.3.3. Included Files
5.3.4. Source Statement Listing File
5.3.5. Cross-reference Listing
5.3.6. Diagnostic Messages
5.3.7. Diagnostic Message Listing File
5.3.8. Object File
5.3.9. Creating a Binary Definition File
5.4. Linking
6. CAL Source Statements
6.1. Source Statement Format
6.1.1. Label Field
6.1.2. Result Field
6.1.3. Operand Field
6.1.4. Comment Field
6.1.5. Old Format
6.1.6. Case Sensitivity
6.2. Symbols
6.2.1. Symbol Qualification
6.2.2. Symbol Definition
6.2.3. Symbol Attributes
6.2.4. Symbol Reference
6.3. Tags
6.4. Constants
6.4.1. Floating Constant
6.4.2. Integer Constant
6.4.3. Character Constants
6.5. Data Items
6.5.1. Floating Data Item
6.5.2. Integer Data Item
6.5.3. Character Data Item
6.6. Literals
6.7. Micros
6.8. Location Elements
6.8.1. Location Counter
6.8.2. Origin Counter
6.8.3. Longword-bit-position Counter
6.8.4. Force Longword Boundary
6.9. Expressions
6.9.1. Operators
6.9.2. Operator Precedence
6.9.3. Restrictions
6.10. Statement Editing
6.10.1. Micro Substitution
6.10.2. Concatenate
6.10.3. Append
6.10.4. Continuation
6.10.5. Comment
6.10.6. Actual Statements and Edited Statements
7. CAL Pseudo Instruction Descriptions
7.1. Equate Symbol (=)
7.2. (Deferred implementation) ALIGN
7.3. BASE
7.4. BITW
7.5. BSS
7.6. BSSZ
7.7. CMICRO
7.8. COMMENT
7.9. CON
7.10. DATA
7.11. DBSM
7.12. DECMIC
7.13. DMSG
7.14. DUP
7.15. ECHO
7.16. EDIT
7.17. EJECT
7.18. ELSE
7.19. END
7.20. ENDDUP
7.21. ENDIF
7.22. ENDM
7.23. ENDTEXT
7.24. ENTRY
7.25. ERRIF
7.26. ERROR
7.27. EXITM
7.28. EXT
7.29. FORMAT
7.30. IDENT
7.31. IFA
7.32. IFC
7.33. IFE
7.34. IFM
7.35. INCLUDE
7.36. LIST
7.37. LOC
7.38. LOCAL
7.39. MACRO
7.40. MICRO
7.41. MICSIZE
7.42. MLEVEL
7.43. MSG
7.44. NEXTDUP
7.45. NOMSG
7.46. OCTMIC
7.47. HEXMIC
7.48. OPDEF
7.49. OPSYN
7.50. ORG
7.51. OSINFO
7.52. QUAL
7.53. SECTION
7.53.1. Local Sections
7.53.2. Main Sections
7.53.3. Literals Section
7.53.4. Sections Defined by the SECTION Pseudo Instruction
7.53.5. Common Sections
7.53.6. Section Stack Buffer
7.53.7. Generated Code Position Counters
7.54. SET
7.55. SKIP
7.56. SPACE
7.57. STACK
7.58. START
7.59. STOPDUP
7.60. SUBTITLE
7.61. TEXT
7.62. TITLE
7.63. VWD
8. Cray X1 Instruction Set and Encoding
8.1. System and Memory Ordering Instructions
8.1.1. System Instructions
8.1.2. Memory Ordering Instructions
8.2. Register Move and Jump Instructions
8.2.1. Register Move Instructions
8.2.2. Jump Instructions
8.3. A Register Instructions
8.3.1. A Register Integer Instructions
8.3.2. A Register Logical Instructions
8.3.3. A Register Shift Instructions
8.3.4. A Register Immediate Instructions
8.3.5. A Register Integer Compare Instructions
8.3.6. A Register Byte and Halfword Instructions
8.3.7. Other A Register Instructions
8.3.8. A Register Branch Instructions
8.3.9. A Register Memory Access Instructions
8.4. S Register Instructions
8.4.1. S Register Integer Instructions
8.4.2. S Register Logical Instructions
8.4.3. S Register Shift Instructions
8.4.4. S Register Immediate Instructions
8.4.5. S Register Integer Compare Instructions
8.4.6. Other S Register Instructions
8.4.7. S Register Branch Instructions
8.4.8. S Register Floating Point Instructions
8.4.9. S Register Floating Point Compare Instructions
8.4.10. S Register Conversion Instructions
8.4.11. S Register Memory Instructions
8.5. Vector Register Instructions
8.5.1. Vector Register Integer Instructions
8.5.2. Vector Register Logical Instructions
8.5.3. Vector Register Shift Instructions
8.5.4. Vector Register Integer Compare Instructions
8.5.5. Vector Register Floating Point Instructions
8.5.6. Vector Register Floating Point Compare Instructions
8.5.7. Vector Register Conversion Instructions
8.5.8. Other Vector Register Instructions
8.5.9. Vector Mask Instructions
8.5.10. Vector Memory Instructions
8.5.11. Privileged Instructions
9. CAL Defined Sequences
9.1. Similarities Among Defined Sequences
9.1.1. Editing
9.1.2. Definition Format
9.1.3. Formal Parameters
9.1.4. Instruction Calls
9.1.5. Interaction with the INCLUDE Pseudo Instruction
9.2. Macros (MACRO)
9.2.1. Macro Definition
9.2.2. Macro Calls
9.3. Operation Definitions (OPDEF)
9.3.1. Opdef Definition
9.3.2. Opdef Calls
9.4. Duplication (DUP)
9.5. Duplicate with Varying Argument (ECHO)
9.6. Ending a Macro or Operation Definition (ENDM)
9.7. Premature Exit from a Macro Expansion (EXITM)
9.8. Ending Duplicated Code (ENDDUP)
9.9. Premature Exit of the Current Iteration of Duplication Expansion (NEXTDUP)
9.10. Stopping Duplication (STOPDUP)
9.11. Specifying Local Unique Character String Replacements (LOCAL)
9.12. Synonymous Operations (OPSYN)
A. Calling Conventions
B. ASDEF Macros and Opdefs
C. Character Set
Glossary
Index
List of Tables
2-1. Cray X1 Registers
2-2. Processor State Information
2-4. Quadrant Modifications
2-5. Scalar Memory References
2-6. Branches and Jumps
2-7. Scalar Integer Functions
2-8. Integer Relations
2-9. Scalar Floating-point Functions
2-10. Bit Matrix Multiply Instructions
2-11. Byte and Halfword Access
2-12. Scalar Atomic Memory Operations
2-14. Other Scalar Instructions
2-15. Vector Memory References
2-16. Elemental Vector Functions
2-17. Mask Operations
2-18. Other Vector Instructions
2-20. Explicit Memory Ordering Instructions
2-21. Special Syntax Forms
C-1. Character Set
List of Figures
4-1. CAL Program Organization
5-1. Page Header Format
5-2. Source Statement Listing Format
5-3. Cross-reference Listing Format
6-1. ASCII Character with Left-justification and Blank-fill
6-2. ASCII Character with Left-justification and Zero-fill
6-3. ASCII Character with Right-justification and Zero-fill
6-4. ASCII Character with Right-justification in 8 bits
7-1. Storage of Unlabeled Data Items
7-2. Storage of Labeled and Unlabeled Data Items