📄 vaxfloat.s
字号:
# # if the instruction was polyh then the user's sp is # incremented by 16 to unstack the argument. # # the fpd bit in the psl is cleared. # # instruction emulation is now complete. # # # careful reading of the above outline will show that the # polyg and polyh instructions are correctly emulated even down # to the handling of faults. faults may be detected at any of # the probes and at some of the pack and unpack operations. when # faults are detected control immediatly leaves the outline so # it is important that everything be correct at the time the # check is made. the reader may notice that some results are # packed and then immediatly unpacked. this is done to check for # overflow and underflow and to perform any rounding specified # by the architecture. this technique also converts nonstandard # floating zero representations to standard ones. # # # 4f acbf - add compare and branch f_floating # inst_acbf: set_op_types f brb inst_acbx # # 6f acbd - add compare and branch d_floating # inst_acbd: set_op_types d brb inst_acbx # # 4ffd acbg - add compare and branch g_floating # inst_acbg: set_op_types g brb inst_acbx # # 6ffd acbh - add compare and branch h_floating # inst_acbh: set_op_types h # brb inst_acbx inst_acbx: bsbw read_access # first operand is read only bsbw unpack_float3 # unpack and save the value bsbw read_access # second operand is read only bsbw unpack_float2 # unpack and save the value bsbw modify_access # third operand is modified movl r11,address1(fp) # save the operand address bsbw unpack_float1 # unpack and save the value bsbw branch_word # fourth operand is branch destination movl r11,address2(fp) # save the branch destination bsbw add_real # add the step and index bsbw pack_float1 # pack the index value movl address1(fp),r11 # r11 = destination address bsbw store_operand # store into third operand bsbw unpack_float1 # put the value back movab operand1(fp),r1 # r1 = location of index value bsbw test_real # test the value bsbw set_condition # set the condition codes bicb2 $pslm_v,psl(fp) # clear v in the psl movab operand2(fp),r1 # r1 = address of step value bsbw test_real # test the value blss 2f # it's negative - bypass movab operand1(fp),r1 # r1 = address of index value movab operand3(fp),r2 # r2 = address of limit value bsbw compare_real # have we passed the limit ? bgtr 3f # yes - bypass 1: movl address2(fp),reg_pc(fp) # perform the branch brb 3f # bypass 2: movab operand1(fp),r1 # r1 = address of index value movab operand3(fp),r2 # r2 = address of limit value bsbw compare_real # have we passed the limit ? bgeq 1b # no - perform the branch 3: brw normal_exit # done # # 40 addf2 - add f_floating (two operands) # inst_addf2: # entrance set_op_types f brb inst_addx2 # # 60 addd2 - add d_floating (two operands) # inst_addd2: # entrance set_op_types d brb inst_addx2 # # 40fd addg2 - add g_floating (two operands) # inst_addg2: # entrance set_op_types g brb inst_addx2 # # 60fd addh2 - add hfloat (two operands) # inst_addh2: # entrance set_op_types h #brb inst_addx2 inst_addx2: bsbw read_access # first operand is read only bsbw unpack_float1 # unpack and save the value bsbw modify_access # second operand is modified movl r11,address1(fp) # save the destination location bsbw unpack_float2 # unpack and save the value bsbw add_real # compute the sum bsbw pack_float1 # pack the sum movl address1(fp),r11 # r11 = destination location bsbw store_operand # store the result bsbw set_condition1 # set the condition codes in the psl brw normal_exit # done # # 41 addf3 - add f_floating (three operands) # inst_addf3: # entrance set_op_types f brb inst_addx3 # # 61 addd3 - add d_floating (three operands) # inst_addd3: # entrance set_op_types d brb inst_addx3 # # 41fd addg3 - add g_floating (three operands) # inst_addg3: # entrance set_op_types g brb inst_addx3 # # 61fd addh3 - add hfloat (three operands) # inst_addh3: # entrance set_op_types h #brb inst_addx3 inst_addx3: bsbw read_access # first operand is read only bsbw unpack_float1 # unpack and save the value bsbw read_access # second operand is read only bsbw unpack_float2 # unpack and save the value bsbw write_access # third operand is write only movl r11,address1(fp) # save the destination address bsbw add_real # compute the sum bsbw pack_float1 # pack the sum movl address1(fp),r11 # r11 = destination location bsbw store_operand # store the result bsbw set_condition1 # set the condition codes in the psl brw normal_exit # done # # 7cfd clro - clear octaword # # 7cfd clrh - clear h_floating # inst_clro: # entrance set_op_types o bsbw write_access # first operand is write only clrq (r11)+ # clear the first part of the value clrq (r11) # clear the second part of the value bicl2 $pslm_nzv,psl(fp) # clear the condition codes except c bisl2 $pslm_z,psl(fp) # set the z bit in the psl brw normal_exit # done # # 51 cmpf - compare f_floating # inst_cmpf: # entrance set_op_types f brb inst_cmpx # # 71 cmpd - compare d_floating # inst_cmpd: # entrance set_op_types d brb inst_cmpx # # 51fd cmpg - compare g_floating # inst_cmpg: # entrance set_op_types g brb inst_cmpx # # 71fd cmph - compare h_floating # inst_cmph: # entrance set_op_types h #brb inst_cmpx inst_cmpx: bsbw read_access # first operand is read only bsbw unpack_float1 # unpack and save the value bsbw read_access # second operand is read only bsbw unpack_float2 # unpack and save the value movab operand1(fp),r1 # r1 = location of first value movab operand2(fp),r2 # r2 = location of second value bsbw compare_real # compare the values bsbw set_condition # set the condition codes bicl2 $pslm_vc,psl(fp) # clear the v bit and c bit in the psl brw normal_exit # done # # 4c cvtbf - convert byte to f_floating # inst_cvtbf: # entrance set_op_types b,f brb inst_cvtbx # # 6c cvtbd - convert byte to d_floating # inst_cvtbd: # entrance set_op_types b,d brb inst_cvtbx # # 4cfd cvtbg - convert byte to g_floating # inst_cvtbg: # entrance set_op_types b,g brb inst_cvtbx # # 6cfd cvtbh - convert byte to h_floating # inst_cvtbh: # entrance set_op_types b,h brb inst_cvtbx # # 4d cvtwf - convert word to f_floating # inst_cvtwf: set_op_types w,f brb inst_cvtwx # # 6d cvtwd - convert word to d_floating # inst_cvtwd: set_op_types w,d brb inst_cvtwx # # 4dfd cvtwg - convert word to g_floating # inst_cvtwg: # entrance set_op_types w,g brb inst_cvtwx # # 6dfd cvtwh - convert word to h_floating # inst_cvtwh: # entrance set_op_types w,h brb inst_cvtwx # # 4e cvtlf - convert long to f_floating # inst_cvtlf: # entrance set_op_types l,f brb inst_cvtlx # # 6e cvtld - convert long to d_floating # inst_cvtld: # entrance set_op_types l,d brb inst_cvtlx # # 4efd cvtlg - convert long to g_floating # inst_cvtlg: # entrance set_op_types l,g brb inst_cvtlx # # 6efd cvtlh - convert long to h_floating # inst_cvtlh: # entrance set_op_types l,h #brb inst_cvtlx inst_cvtbx: inst_cvtwx: inst_cvtlx: bsbw read_access # first operand is read only bsbw float_long # convert to floating and save value incl op_index(fp) # move to second operand bsbw write_access # second operand is write only movl r11,address1(fp) # save the destination address bsbw pack_float1 # pack the value movl address1(fp),r11 # r11 = destination location bsbw store_operand # store the result bsbw set_condition1 # set the condition codes in the psl brw normal_exit # done # # 48 cvtfb - convert f_floating to byte # inst_cvtfb: set_op_types f,b brb inst_cvtxb # # 68 cvtdb - convert d_floating to byte # inst_cvtdb: set_op_types d,b brb inst_cvtxb # # 48fd cvtgb - convert g_floating to byte # inst_cvtgb: set_op_types g,b brb inst_cvtxb # # 68fd cvthb - convert h_floating to byte # inst_cvthb: set_op_types h,b brb inst_cvtxb # # 49 cvtfw - convert f_floating to word # inst_cvtfw: set_op_types f,w brb inst_cvtxw # # 69 cvtdw - convert d_floating to word # inst_cvtdw: set_op_types d,w brb inst_cvtxw # # 49fd cvtgw - convert g_floating to word # inst_cvtgw: set_op_types g,w brb inst_cvtxw # # 69fd cvthw - convert h_floating to word # inst_cvthw: set_op_types h,w brb inst_cvtxw # # 4a cvtfl - convert f_floating to long # inst_cvtfl: set_op_types f,l brb inst_cvtxl # # 6a cvtdl - convert d_floating to long # inst_cvtdl: set_op_types d,l brb inst_cvtxl # # 4afd cvtgl - convert g_floating to long # inst_cvtgl: set_op_types g,l brb inst_cvtxl # # 6afd cvthl - convert h_floating to long # inst_cvthl: set_op_types h,l brb inst_cvtxl inst_cvtxb: inst_cvtxw: inst_cvtxl: bsbw read_access # first operand is read only bsbw unpack_float1 # unpack and save the value incl op_index(fp) # move to second operand bsbw write_access # second operand is write only movl r11,address1(fp) # save the destination location bicl2 $pslm_nzvc,psl(fp) # clear the condition codes bsbw fix_real # fix the value cmpb *op_index(fp),$typ_w # case on datatype bgtr 3f # skip if longword beql 1f # skip if word cvtlb r0,r0 # convert long to byte brb 2f # continue 1: cvtlw r0,r0 # conve
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -