Skip to content

Commit

Permalink
Initial work to support 32bit ASM on OS/2
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Smedley <paul@smedley.id.au>
  • Loading branch information
psmedley committed Feb 21, 2023
1 parent 27d19ea commit 3713163
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 23 deletions.
Expand Up @@ -741,3 +741,12 @@ SECTION .note.GNU-stack noalloc noexec nowrite progbits ; Mark the stack as non-
%endif
%endif
%endmacro

; Needed on OS/2 where it is 16-bit by default.
%macro SECTION_TEXT 0
%ifidn __OUTPUT_FORMAT__,obj
SEGMENT TEXT32 CLASS=CODE USE32
%else
SECTION .text
%endif
%endmacro
Expand Up @@ -50,7 +50,7 @@
; Code
;******************************************************************************************

SECTION .text
SECTION_TEXT

; refer to "The IA-32 Intel(R) Architecture Software Developers Manual, Volume 2A A-M"
; section CPUID - CPU Identification
Expand Down
Expand Up @@ -54,7 +54,7 @@



SECTION .text
SECTION_TEXT


;;;;;;;expanding result;;;;;;;
Expand Down
Expand Up @@ -45,7 +45,7 @@
; Code
;***********************************************************************

SECTION .text
SECTION_TEXT

;***********************************************************************
; void WelsI16x16LumaPredH_sse2(uint8_t *pred, uint8_t *pRef, int32_t stride);
Expand Down
Expand Up @@ -56,7 +56,7 @@
; Code
;***********************************************************************

SECTION .text
SECTION_TEXT


;***********************************************************************
Expand Down
Expand Up @@ -63,7 +63,7 @@ h264_d0x20_mmx:
; Code
;=============================================================================

SECTION .text
SECTION_TEXT

;*******************************************************************************
; void McChromaWidthEq4_mmx( const uint8_t *src,
Expand Down
Expand Up @@ -114,7 +114,7 @@ h264_mc_hc_32:
; Code
;*******************************************************************************

SECTION .text
SECTION_TEXT

%ifdef X86_32_PICASM

Expand Down Expand Up @@ -235,7 +235,7 @@ movd %9, %1
; Code
;*******************************************************************************

SECTION .text
SECTION_TEXT

;***********************************************************************
; void McHorVer22Width8HorFirst_sse2(const int16_t *pSrc,
Expand Down Expand Up @@ -526,7 +526,7 @@ WELS_EXTERN McHorVer02WidthEq8_sse2
; Code
;***********************************************************************

SECTION .text
SECTION_TEXT



Expand Down
Expand Up @@ -138,7 +138,7 @@
; Code
;***********************************************************************

SECTION .text
SECTION_TEXT

; , 6/7/2010

Expand Down
Expand Up @@ -42,7 +42,7 @@

%include "asm_inc.asm"

SECTION .text
SECTION_TEXT

;void WelsBlockZero16x16_sse2(int16_t * block, int32_t stride);
WELS_EXTERN WelsBlockZero16x16_sse2
Expand Down
Expand Up @@ -171,7 +171,7 @@ sse2_wd_0x02: times 8 dw 0x02
; Code
;*******************************************************************************

SECTION .text
SECTION_TEXT


;*******************************************************************************
Expand Down
Expand Up @@ -368,7 +368,7 @@ byte_1pos_table:
;***********************************************************************
; Code
;***********************************************************************
SECTION .text
SECTION_TEXT


%ifdef X86_32
Expand Down
Expand Up @@ -39,7 +39,7 @@

%include "asm_inc.asm"

SECTION .text
SECTION_TEXT

;***********************************************************************
; SSE2 functions
Expand Down
Expand Up @@ -183,7 +183,7 @@ mmx_0x02: dw 0x02, 0x00, 0x00, 0x00
; Code
;***********************************************************************

SECTION .text
SECTION_TEXT

;***********************************************************************
; void WelsI4x4LumaPredH_sse2(uint8_t *pred, uint8_t *pRef, int32_t stride)
Expand Down
Expand Up @@ -183,7 +183,7 @@
%endmacro ; end of TRANSPOSE8x16_WRITE_ALT_SSE2


SECTION .text
SECTION_TEXT

WELS_EXTERN TransposeMatrixBlock16x16_sse2
; void TransposeMatrixBlock16x16_sse2( void *dst/*16x16*/, const int32_t dst_stride, void *src/*16x16*/, const int32_t src_stride );
Expand Down
Expand Up @@ -45,7 +45,7 @@
; Code
;***********************************************************************

SECTION .text
SECTION_TEXT

;***********************************************************************
;void WelsPrefetchZero_mmx(int8_t const*_A);
Expand Down
Expand Up @@ -43,7 +43,7 @@
%include "asm_inc.asm"


SECTION .text
SECTION_TEXT
;************************************************
;NEW_QUANT
;************************************************
Expand Down Expand Up @@ -172,7 +172,7 @@ WELS_EXTERN WelsQuantFour4x4Max_sse2
punpckldq %1, %1
%endmacro

SECTION .text
SECTION_TEXT

%macro MMX_Quant4 4
pxor %2, %2
Expand Down
Expand Up @@ -45,7 +45,7 @@ mv_x_inc_x4 dw 0x10, 0x10, 0x10, 0x10
mv_y_inc_x4 dw 0x04, 0x04, 0x04, 0x04
mx_x_offset_x4 dw 0x00, 0x04, 0x08, 0x0C

SECTION .text
SECTION_TEXT
%ifdef X86_32
;**********************************************************************************************************************
;void SumOf8x8BlockOfFrame_sse2(uint8_t* pRefPicture, const int32_t kiWidth, const int32_t kiHeight, const int32_t kiRefStride,
Expand Down
Expand Up @@ -165,7 +165,7 @@ low_mask_table:
db 16,20,17,20,20,24


SECTION .text
SECTION_TEXT

;***********************************************************************
;void WelsScan4x4DcAc_sse2( int16_t level[16], int16_t *pDct )
Expand Down
Expand Up @@ -58,7 +58,7 @@ sse2_20 times 8 dw 20
;***********************************************************************
; Code
;***********************************************************************
SECTION .text
SECTION_TEXT

%macro WEIGHT_LINE 9
movq %2, %9
Expand Down
Expand Up @@ -59,6 +59,10 @@

%ifdef X86_32_PICASM
SECTION .text align=32
%elifidn __OUTPUT_FORMAT__,obj
; OMF needs special handling to ensure everything is in the same segment
; and that the segment is 32 bit.
SECTION TEXT32 align=32 public use32 class=CODE
%else
SECTION .rodata align=32
%endif
Expand Down Expand Up @@ -108,7 +112,7 @@ db 80h, 80h, 80h, 80h, 80h, 80h, 80h, 80h, 80h, 80h, 80h, 02h, 05h, 08h, 0bh, 0e
; Code
;***********************************************************************

SECTION .text
SECTION_TEXT

;***********************************************************************
; void DyadicBilinearDownsamplerWidthx32_sse( unsigned char* pDst, const int iDstStride,
Expand Down
Expand Up @@ -241,7 +241,7 @@
; Code
;***********************************************************************

SECTION .text
SECTION_TEXT

%ifdef X86_32

Expand Down

0 comments on commit 3713163

Please sign in to comment.